835 MB
10,492 files
Updated 4 months ago
Name
Size
README.md1.48 kB
xet
test_api_keys.py1.17 kB
xet
test_setup.py2.8 kB
xet
README.md

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

Contributors