H.1.6: Tests for Capability-Based Agent Discovery
Tests the capability extraction, matching, and recommendation engine.
File: test_capability_discovery.py
Classes
TestCapabilityExtraction
Tests for capability extraction from queries.
TestKeywordExtraction
Tests for keyword extraction from queries.
TestCapabilityMatch
Tests for CapabilityMatch dataclass.
TestAgentRecommendation
Tests for AgentRecommendation dataclass.
TestKeywordConfigurations
Tests for keyword configuration dictionaries.
TestIntegrationPatterns
Tests for integration patterns with mocked database.
TestEdgeCases
Tests for edge cases and boundary conditions.
Functions
test_extract_action_keyword_exact()
Test extraction of exact action keywords.
test_extract_action_keyword_synonym()
Test extraction of action keyword synonyms.
test_extract_multiple_actions()
Test extraction of multiple actions from query.
test_extract_domain_keywords()
Test extraction of domain keywords.
test_extract_multiple_domains()
Test extraction of multiple domains.
test_extract_combined_capabilities()
Test extraction of both actions and domains.
test_empty_query()
Test empty query returns no matches.
test_irrelevant_query()
Test query with no capability keywords.
test_case_insensitivity()
Test case-insensitive matching.
test_extract_keywords_basic()
Test basic keyword extraction.
test_stopword_removal()
Test that stopwords are removed.
test_short_word_removal()
Test that short words (<3 chars) are removed.
test_deduplication()
Test that duplicate keywords are removed.
test_order_preservation()
Test that keyword order is preserved.
test_capability_match_creation()
Test CapabilityMatch creation.
Usage
python test_capability_discovery.py