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

Function test_import_datasources_from_env

api/tests/test_importer.py:120–148  ·  view source on GitHub ↗
(mock_plugins, mock_config, mock_datasource)

Source from the content-addressed store, hash-verified

118@mock.patch("importer.all.import_default_config_from_env", return_value=None)
119@pytest.mark.asyncio
120async def test_import_datasources_from_env(mock_plugins, mock_config, mock_datasource):
121 os.environ[
122 "IQENGINE_CONNECTION_INFO"
123 ] = """
124 {
125 "settings":
126 [
127 {
128 "accountName": "test_account",
129 "containerName": "test_container",
130 "sasToken": "test_sas_token",
131 "name": "test_name",
132 "description": "test_description",
133 "imageURL": "test_image_url",
134 "accountKey": "test_account_key"
135 }
136 ]
137 }
138 """
139
140 mock_datasource.datasource_exists = AsyncMock()
141 mock_datasource.datasource_exists.return_value = False
142 mock_datasource.create = AsyncMock()
143 mock_datasource.create.return_value = None
144
145 await import_all_from_env()
146
147 mock_datasource.datasource_exists.assert_called_once()
148 mock_datasource.create.assert_called_once()

Callers

nothing calls this directly

Calls 1

import_all_from_envFunction · 0.90

Tested by

no test coverage detected