Testing - cnnsyhnx/CrowdInsight GitHub Wiki

๐Ÿงช Testing

Unit tests live in the tests/ folder.

๐Ÿงช Run Tests

python -m unittest discover tests/

๐Ÿ“ Sample Test File

# tests/test_detector.py

import unittest
from crowdinsight.detector import ObjectDetector

class TestObjectDetector(unittest.TestCase):
    def setUp(self):
        self.detector = ObjectDetector()

    def test_image_detection(self):
        result = self.detector.detect("images/test1.jpg")
        self.assertIsInstance(result, dict)