#!/usr/bin/env python3 """Tests for wake-word detector.""" import unittest from unittest.mock import Mock, patch, MagicMock import sys from pathlib import Path # Add parent directory to path sys.path.insert(0, str(Path(__file__).parent.parent)) try: import sys from pathlib import Path # Add wake-word directory to path wake_word_dir = Path(__file__).parent if str(wake_word_dir) not in sys.path: sys.path.insert(0, str(wake_word_dir)) from detector import WakeWordDetector HAS_DETECTOR = True except ImportError as e: HAS_DETECTOR = False print(f"Warning: Could not import detector: {e}") class TestWakeWordDetector(unittest.TestCase): """Test wake-word detector.""" def test_import(self): """Test that detector can be imported.""" if not HAS_DETECTOR: self.skipTest("Detector dependencies not available") self.assertIsNotNone(WakeWordDetector) def test_initialization(self): """Test detector initialization (structure only).""" if not HAS_DETECTOR: self.skipTest("Detector dependencies not available") # Just verify the class exists and has expected attributes self.assertTrue(hasattr(WakeWordDetector, '__init__')) self.assertTrue(hasattr(WakeWordDetector, 'start')) self.assertTrue(hasattr(WakeWordDetector, 'stop')) if __name__ == "__main__": unittest.main()