Buckets:
835 MB
10,492 files
Updated 4 months ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| README.md | 1.48 kB xet | bf7e9c59 | |
| test_api_keys.py | 1.17 kB xet | 3ccbd534 | |
| test_setup.py | 2.8 kB xet | f5192d8f |
Tests
Overview
This directory contains all test files for the CA10 Knowledge Graphs project.
Running Tests
Run All Tests
cd tests
python test_setup.py
python test_api_keys.py
Run with pytest
pytest test_*.py -v
Run Specific Test
python test_setup.py
Test Files
test_setup.py
Tests the project setup and configuration:
- Directory structure
- Required files
- Dependencies
- Configuration files
test_api_keys.py
Tests API key configuration:
- Environment variable loading
- API key validation
- Connection testing
Writing Tests
When adding new features, please add corresponding tests:
import unittest
from src.core.knowledge_graph import KnowledgeGraph
class TestKnowledgeGraph(unittest.TestCase):
def setUp(self):
self.kg = KnowledgeGraph()
def test_add_entity(self):
self.kg.add_entity("test_entity", "test_type")
self.assertIn("test_entity", self.kg.entities)
def test_add_relation(self):
self.kg.add_relation("entity1", "relates_to", "entity2")
self.assertEqual(len(self.kg.relations), 1)
if __name__ == '__main__':
unittest.main()
Test Coverage
Run coverage analysis:
pytest --cov=src tests/
Continuous Integration
Tests are automatically run on:
- Pull requests
- Commits to main branch
- Scheduled daily runs
Note: Make sure all tests pass before submitting pull requests.
- Total size
- 835 MB
- Files
- 10,492
- Last updated
- Jun 17
- Pre-warmed CDN
- US EU US EU