diff --git a/scripts/test/ISISPowderRunDetailsTest.py b/scripts/test/ISISPowderRunDetailsTest.py index 2770b0889ebc3042fb4f4e10bc45841f8b787231..305fd52c7c0d987787219b391996522f41e68ce9 100644 --- a/scripts/test/ISISPowderRunDetailsTest.py +++ b/scripts/test/ISISPowderRunDetailsTest.py @@ -46,6 +46,9 @@ class ISISPowderInstrumentRunDetailsTest(unittest.TestCase): self.assertEqual(output_obj.empty_runs, expected_empty_runs) self.assertEqual(output_obj.grouping_file_path, os.path.join(mock_inst.calibration_dir, mock_inst.grouping_file_name)) + expected_file_ext = mock_inst.file_extension + expected_file_ext = expected_file_ext if expected_file_ext.startswith('.') else '.' + expected_file_ext + self.assertEqual(output_obj.file_extension, expected_file_ext) self.assertEqual(output_obj.label, expected_label) self.assertEqual(output_obj.offset_file_path, os.path.join(mock_inst.calibration_dir, expected_label, expected_offset_file_name)) @@ -119,6 +122,7 @@ class MockInstSettings(object): self.calibration_dir = calibration_dir self.cal_mapping_path = cal_file_path self.grouping_file_name = MockInstSettings.gen_random_string() + self.file_extension = MockInstSettings.gen_random_string() @staticmethod def gen_random_string(): diff --git a/scripts/test/ISISPowderYamlParserTest.py b/scripts/test/ISISPowderYamlParserTest.py index 78069332c53178b4bd5bd53c1bbbf401b611dce6..61a99572e40854e8a6bc34066ad2ceb2e3081ec0 100644 --- a/scripts/test/ISISPowderYamlParserTest.py +++ b/scripts/test/ISISPowderYamlParserTest.py @@ -115,15 +115,15 @@ class ISISPowderYamlParserTest(unittest.TestCase): file_handle.close() # Test a value in the middle of 1-10 - with assertRaisesRegex(self, ValueError, "Run number 5 not recognised in calibration mapping"): + with assertRaisesRegex(self, ValueError, "Run number 5 not recognised in cycle mapping file"): yaml_parser.get_run_dictionary(run_number_string="5", file_path=file_path) # Check on edge of invalid numbers - with assertRaisesRegex(self, ValueError, "Run number 9 not recognised in calibration mapping"): + with assertRaisesRegex(self, ValueError, "Run number 9 not recognised in cycle mapping file"): yaml_parser.get_run_dictionary(run_number_string=9, file_path=file_path) # What about a range of numbers - with assertRaisesRegex(self, ValueError, "Run number 2 not recognised in calibration mapping"): + with assertRaisesRegex(self, ValueError, "Run number 2 not recognised in cycle mapping file"): yaml_parser.get_run_dictionary(run_number_string="2-8", file_path=file_path) # Check valid number still works