Skip to content

Commit

Permalink
update tests and gitmodules
Browse files Browse the repository at this point in the history
  • Loading branch information
walshmm committed Dec 2, 2024
1 parent a203d46 commit 4d87b2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/unit/backend/data/test_GroceryService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/backend/service/test_CalibrationService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 4d87b2c

Please sign in to comment.