From 832ddafb6938b9ddaaa71b2af01f0e381feb9dd5 Mon Sep 17 00:00:00 2001 From: Milo Thurston Date: Mon, 9 Feb 2026 13:37:39 +0000 Subject: [PATCH] Changed tests to reflect changed table headers. #609 --- isatools/constants.py | 1 + isatools/isatab/validate/rules/rules_40xx.py | 1 + tests/convert/test_mzml2isa.py | 6 +++--- tests/isatab/validate/test_core.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/isatools/constants.py b/isatools/constants.py index 7a56c2c4..15d061f0 100644 --- a/isatools/constants.py +++ b/isatools/constants.py @@ -23,6 +23,7 @@ "Acquisition Parameter Data File", "Metabolite Assignment File", "Metabolite Identification File", + "Normalization Name" ] _LABELS_DATA_NODES = [ diff --git a/isatools/isatab/validate/rules/rules_40xx.py b/isatools/isatab/validate/rules/rules_40xx.py index 7850114d..de95b4d6 100644 --- a/isatools/isatab/validate/rules/rules_40xx.py +++ b/isatools/isatab/validate/rules/rules_40xx.py @@ -448,6 +448,7 @@ def load_table_checks(df, filename): "Hybridization Assay Name", "Array Design REF", "Scan Name", + "Normalization Name", "Data Transformation Name", ] and not _RX_PARAMETER_VALUE.match(col) diff --git a/tests/convert/test_mzml2isa.py b/tests/convert/test_mzml2isa.py index 9d1a6143..7ac85343 100644 --- a/tests/convert/test_mzml2isa.py +++ b/tests/convert/test_mzml2isa.py @@ -24,7 +24,7 @@ def test_mzml2isa_convert_investigation(self): os.path.join(self._mzml_data_dir, study_id + "-partial"), self._tmp_dir, study_id, validate_output=True ) self.assertEqual(len(report["warnings"]), 8) - self.assertEqual(len(report["errors"]), 3) + self.assertEqual(len(report["errors"]), 2) # Strip out the line with Comment[Created With Tool] to avoid changes in version number generated by mzml2isa with open(os.path.join(self._tmp_dir, "i_Investigation.txt")) as in_fp, StringIO() as stripped_actual_file: @@ -45,7 +45,7 @@ def test_mzml2isa_convert_study_table(self): os.path.join(self._mzml_data_dir, study_id + "-partial"), self._tmp_dir, study_id, validate_output=True ) self.assertEqual(len(report["warnings"]), 8) - self.assertEqual(len(report["errors"]), 3) + self.assertEqual(len(report["errors"]), 2) with open(os.path.join(self._tmp_dir, "s_{}.txt".format(study_id))) as out_fp: with open( os.path.join(self._tab_data_dir, study_id + "-partial", "s_{}.txt".format(study_id)) @@ -59,7 +59,7 @@ def test_mzml2isa_convert_assay_table(self): ) self.assertTrue(report["validation_finished"]) self.assertEqual(len(report["warnings"]), 8) - self.assertEqual(len(report["errors"]), 3) + self.assertEqual(len(report["errors"]), 2) with open( os.path.join(self._tmp_dir, "a_{}_metabolite_profiling_mass_spectrometry.txt".format(study_id)) ) as out_fp: diff --git a/tests/isatab/validate/test_core.py b/tests/isatab/validate/test_core.py index 45cd333c..6f3f796b 100644 --- a/tests/isatab/validate/test_core.py +++ b/tests/isatab/validate/test_core.py @@ -23,13 +23,13 @@ def test_mtbls267(self): with open(path.join(data_path, "i_Investigation.txt"), "r") as data_file: r = validate(fp=data_file, config_dir=self.default_conf, origin="mzml2isa") print(r["warnings"]) - self.assertEqual(len(r["errors"]), 4) + self.assertEqual(len(r["errors"]), 3) def test_mtbls_1846(self): data_path = path.join(path.dirname(path.abspath(__file__)), "..", "..", "data", "mtbls", "MTBLS1846") with open(path.join(data_path, "i_Investigation.txt"), "r") as data_file: r = validate(fp=data_file, config_dir=self.default_conf) - self.assertEqual(len(r["errors"]), 20) + self.assertEqual(len(r["errors"]), 18) def test_bii_i_1(self): data_path = path.join(path.dirname(path.abspath(__file__)), "..", "..", "data", "tab", "BII-I-1")