|
13 | 13 | from codeocean.data_asset import DataAsset |
14 | 14 |
|
15 | 15 | from aind_data_asset_indexer.utils import ( |
16 | | - build_docdb_location_to_id_map, |
17 | 16 | build_metadata_record_from_prefix, |
18 | 17 | compute_md5_hash, |
19 | 18 | cond_copy_then_sync_core_json_files, |
@@ -1226,46 +1225,6 @@ def test_cond_copy_then_sync_core_json_files_mismatch( |
1226 | 1225 | Bucket=bucket, Key=f"{pfx}/rig.json" |
1227 | 1226 | ) |
1228 | 1227 |
|
1229 | | - @patch("aind_data_access_api.utils.MetadataDbClient") |
1230 | | - def test_build_docdb_location_to_id_map( |
1231 | | - self, mock_docdb_client: MagicMock |
1232 | | - ): |
1233 | | - """Tests build_docdb_location_to_id_map""" |
1234 | | - bucket = "aind-ephys-data-dev-u5u0i5" |
1235 | | - mock_docdb_client.aggregate_docdb_records.return_value = [ |
1236 | | - { |
1237 | | - "_id": "70bcf356-985f-4a2a-8105-de900e35e788", |
1238 | | - "location": ( |
1239 | | - f"s3://{bucket}/ecephys_655019_2000-04-04_04-00-00" |
1240 | | - ), |
1241 | | - }, |
1242 | | - { |
1243 | | - "_id": "5ca4a951-d374-4f4b-8279-d570a35b2286", |
1244 | | - "location": ( |
1245 | | - f"s3://{bucket}/ecephys_567890_2000-01-01_04-00-00" |
1246 | | - ), |
1247 | | - }, |
1248 | | - ] |
1249 | | - |
1250 | | - actual_map = build_docdb_location_to_id_map( |
1251 | | - docdb_api_client=mock_docdb_client, |
1252 | | - bucket=bucket, |
1253 | | - prefixes=[ |
1254 | | - "ecephys_655019_2000-04-04_04-00-00", |
1255 | | - "ecephys_567890_2000-01-01_04-00-00/", |
1256 | | - "missing_655019_2000-01-01_01-01-02", |
1257 | | - ], |
1258 | | - ) |
1259 | | - expected_map = { |
1260 | | - f"s3://{bucket}/ecephys_655019_2000-04-04_04-00-00": ( |
1261 | | - "70bcf356-985f-4a2a-8105-de900e35e788" |
1262 | | - ), |
1263 | | - f"s3://{bucket}/ecephys_567890_2000-01-01_04-00-00": ( |
1264 | | - "5ca4a951-d374-4f4b-8279-d570a35b2286" |
1265 | | - ), |
1266 | | - } |
1267 | | - self.assertEqual(expected_map, actual_map) |
1268 | | - |
1269 | 1228 | @patch("codeocean.data_asset.DataAssets.search_data_assets_iterator") |
1270 | 1229 | def test_get_all_processed_codeocean_asset_records( |
1271 | 1230 | self, mock_search_all_data_assets: MagicMock |
|
0 commit comments