Skip to content

Commit f57ee34

Browse files
authored
Fix tests to use new metadata format (#22)
* Fix tests to use new metadata format * Fix dict init
1 parent a243a04 commit f57ee34

File tree

3 files changed

+15
-28
lines changed

3 files changed

+15
-28
lines changed

tests/metadata.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/test_convert_raw_ephys.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ def test_add_electrode_data():
1616
"""
1717
# Create a test metadata dictionary
1818
metadata = {}
19-
metadata["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
20-
metadata["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
21-
metadata["electrodes_location"] = "Nucleus Accumbens core"
22-
metadata["device"] = {
19+
metadata["ephys"] = {}
20+
metadata["ephys"]["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
21+
metadata["ephys"]["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
22+
metadata["ephys"]["electrodes_location"] = "Nucleus Accumbens core"
23+
metadata["ephys"]["device"] = {
2324
"name": "Probe",
2425
"description": "Berke Lab Probe",
2526
"manufacturer": "My Manufacturer",
@@ -51,7 +52,7 @@ def test_add_electrode_data():
5152
eg = nwbfile.electrode_groups["ElectrodeGroup"]
5253
assert eg is not None
5354
assert eg.description == "All electrodes"
54-
assert eg.location == metadata["electrodes_location"]
55+
assert eg.location == metadata["ephys"]["electrodes_location"]
5556
assert eg.device is device
5657

5758
# Test that the nwbfile has the expected electrodes after filtering
@@ -111,11 +112,12 @@ def test_add_raw_ephys():
111112
)
112113

113114
metadata = {}
114-
metadata["openephys_folder_path"] = "tests/test_data/raw_ephys/2022-07-25_15-30-00"
115-
metadata["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
116-
metadata["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
117-
metadata["electrodes_location"] = "Nucleus Accumbens core"
118-
metadata["device"] = {
115+
metadata["ephys"] = {}
116+
metadata["ephys"]["openephys_folder_path"] = "tests/test_data/raw_ephys/2022-07-25_15-30-00"
117+
metadata["ephys"]["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
118+
metadata["ephys"]["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
119+
metadata["ephys"]["electrodes_location"] = "Nucleus Accumbens core"
120+
metadata["ephys"]["device"] = {
119121
"name": "Probe",
120122
"description": "Berke Lab Probe",
121123
"manufacturer": "My Manufacturer",

tests/test_convert_spikes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ def test_add_spikes():
1313
`python tests/test_data/create_spike_test_data.py`.
1414
"""
1515
metadata = {}
16-
metadata["mountain_sort_output_file_path"] = "tests/test_data/processed_ephys/firings.mda"
17-
metadata["sampling_frequency"] = 30_000
16+
metadata["ephys"] = {}
17+
metadata["ephys"]["mountain_sort_output_file_path"] = "tests/test_data/processed_ephys/firings.mda"
18+
metadata["ephys"]["sampling_frequency"] = 30_000
1819

1920
nwbfile = NWBFile(
2021
session_description="Mock session",

0 commit comments

Comments
 (0)