MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / test_import_feature_flags_from_env_update

Function test_import_feature_flags_from_env_update

api/tests/test_importer.py:72–90  ·  view source on GitHub ↗
(
    mock_datasource, mock_plugins, mock_get, mock_collection
)

Source from the content-addressed store, hash-verified

70@mock.patch("importer.all.import_datasources_from_env", return_value=None)
71@pytest.mark.asyncio
72async def test_import_feature_flags_from_env_update(
73 mock_datasource, mock_plugins, mock_get, mock_collection
74):
75 os.environ[
76 "IQENGINE_PLUGINS"
77 ] = '[{"name": "test_plugin", "url": "http://test_plugin"}]'
78 os.environ["IQENGINE_FEATURE_FLAGS"] = '{"test": true}'
79
80 test_config = Configuration()
81 test_config.feature_flags = None
82 mock_get.return_value = test_config
83
84 mock_collection.return_value.update_one = AsyncMock()
85 mock_collection.return_value.insert_one = AsyncMock()
86
87 await import_all_from_env()
88
89 mock_collection.return_value.update_one.assert_called_once()
90 mock_collection.return_value.insert_one.assert_not_called()
91
92
93@mock.patch("importer.config.collection", return_value=Mock())

Callers

nothing calls this directly

Calls 2

ConfigurationClass · 0.90
import_all_from_envFunction · 0.90

Tested by

no test coverage detected