diff --git a/tests/test_BioLogic.py b/tests/test_BioLogic.py index f42e85d..c8bf163 100644 --- a/tests/test_BioLogic.py +++ b/tests/test_BioLogic.py @@ -8,7 +8,7 @@ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal import pytest -from galvani import MPTfile, MPRfile +from galvani import BioLogic, MPTfile, MPRfile from galvani.BioLogic import MPTfileCSV, str3 # not exported testdata_dir = os.path.join(os.path.dirname(__file__), 'testdata') @@ -44,6 +44,37 @@ def test_open_MPT_csv_fails_for_bad_file(): MPTfileCSV(os.path.join(testdata_dir, 'bio_logic1.mpr')) +def test_colID_map_uniqueness(): + """Check some uniqueness properties of the VMPdata_colID_xyz maps.""" + field_colIDs = set(BioLogic.VMPdata_colID_dtype_map.keys()) + flag_colIDs = set(BioLogic.VMPdata_colID_flag_map.keys()) + field_names = [v[0] for v in BioLogic.VMPdata_colID_dtype_map.values()] + flag_names = [v[0] for v in BioLogic.VMPdata_colID_flag_map.values()] + assert not field_colIDs.intersection(flag_colIDs) + # 'I/mA' and 'dQ/mA.h' are duplicated + # assert len(set(field_names)) == len(field_names) + assert len(set(flag_names)) == len(flag_names) + assert not set(field_names).intersection(flag_names) + + +@pytest.mark.parametrize('colIDs, expected', [ + ([1, 2, 3], [('flags', 'u1')]), + ([4, 6], [('time/s', '