(
mock_datasource, mock_plugins, mock_get, mock_collection
)
| 70 | @mock.patch("importer.all.import_datasources_from_env", return_value=None) |
| 71 | @pytest.mark.asyncio |
| 72 | async 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()) |
nothing calls this directly
no test coverage detected