Test that plugin modules can be imported
()
| 19 | |
| 20 | |
| 21 | def test_plugin_module_imports(): |
| 22 | """Test that plugin modules can be imported""" |
| 23 | plugin_modules = [ |
| 24 | 'optillm.plugins.memory_plugin', |
| 25 | 'optillm.plugins.readurls_plugin', |
| 26 | 'optillm.plugins.privacy_plugin', |
| 27 | 'optillm.plugins.genselect_plugin', |
| 28 | 'optillm.plugins.majority_voting_plugin', |
| 29 | 'optillm.plugins.web_search_plugin', |
| 30 | 'optillm.plugins.deep_research_plugin', |
| 31 | 'optillm.plugins.deepthink_plugin', |
| 32 | 'optillm.plugins.longcepo_plugin', |
| 33 | 'optillm.plugins.spl_plugin', |
| 34 | 'optillm.plugins.proxy_plugin', |
| 35 | 'optillm.plugins.mcp_plugin', |
| 36 | 'optillm.plugins.compact_plugin' |
| 37 | ] |
| 38 | |
| 39 | for module_name in plugin_modules: |
| 40 | try: |
| 41 | module = importlib.import_module(module_name) |
| 42 | assert hasattr(module, 'run'), f"{module_name} missing 'run' function" |
| 43 | assert hasattr(module, 'SLUG'), f"{module_name} missing 'SLUG' attribute" |
| 44 | except ImportError as e: |
| 45 | if pytest: |
| 46 | pytest.fail(f"Failed to import {module_name}: {e}") |
| 47 | else: |
| 48 | raise AssertionError(f"Failed to import {module_name}: {e}") |
| 49 | |
| 50 | |
| 51 | def test_plugin_approach_detection(): |