diff --git a/.gitmodules b/.gitmodules index f5c64879f..dcb998528 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "tests/data/snapred-data"] path = tests/data/snapred-data url = https://code.ornl.gov/sns-hfir-scse/infrastructure/test-data/snapred-data.git + branch = main diff --git a/tests/unit/backend/data/test_GroceryService.py b/tests/unit/backend/data/test_GroceryService.py index 48004afd5..7297c9dec 100644 --- a/tests/unit/backend/data/test_GroceryService.py +++ b/tests/unit/backend/data/test_GroceryService.py @@ -325,6 +325,11 @@ def test_diffcal_table_filename_from_workspaceName(self): def test_diffcal_table_filename_from_workspaceName_failure_name_mismatch(self): workspaceName = "bogus_name_" + mockIndexer = mock.Mock() + mockIndexer.readRecord = mock.Mock() + mockDataService = mock.Mock() + mockDataService.calibrationIndexer = mock.Mock(return_value=mockIndexer) + self.instance.dataService = mockDataService with pytest.raises(ValueError, match=r".*Workspace name .* does not match the expected *"): self.instance._createDiffcalTableFilepathFromWsName( self.runNumber, self.useLiteMode, self.version, workspaceName diff --git a/tests/unit/backend/service/test_CalibrationService.py b/tests/unit/backend/service/test_CalibrationService.py index 9f8a7cb61..da3dfedcb 100644 --- a/tests/unit/backend/service/test_CalibrationService.py +++ b/tests/unit/backend/service/test_CalibrationService.py @@ -103,6 +103,7 @@ def test_save(): calibrationService.dataExportService.exportCalibrationWorkspaces = mock.Mock() calibrationService.dataExportService.exportCalibrationIndexEntry = mock.Mock() calibrationService.dataFactoryService.createCalibrationIndexEntry = mock.Mock() + calibrationService.dataFactoryService.calibrationExists = mock.Mock(return_value=False) calibrationService.dataFactoryService.createCalibrationRecord = mock.Mock( return_value=mock.Mock( runNumber="012345", @@ -124,6 +125,7 @@ def test_save_unexpected_units(): calibrationService.dataExportService.exportCalibrationWorkspaces = mock.Mock() calibrationService.dataExportService.exportCalibrationIndexEntry = mock.Mock() calibrationService.dataFactoryService.createCalibrationIndexEntry = mock.Mock() + calibrationService.dataFactoryService.calibrationExists = mock.Mock(return_value=False) calibrationService.dataFactoryService.createCalibrationRecord = mock.Mock( return_value=mock.Mock( runNumber="012345", @@ -143,6 +145,7 @@ def test_save_unexpected_type(): calibrationService.dataExportService.exportCalibrationWorkspaces = mock.Mock() calibrationService.dataExportService.exportCalibrationIndexEntry = mock.Mock() calibrationService.dataFactoryService.createCalibrationIndexEntry = mock.Mock() + calibrationService.dataFactoryService.calibrationExists = mock.Mock(return_value=False) calibrationService.dataFactoryService.createCalibrationRecord = mock.Mock( return_value=mock.Mock( runNumber="012345",