Skip to content

Commit

Permalink
Fix and add to test
Browse files Browse the repository at this point in the history
  • Loading branch information
ktactac-ornl committed May 9, 2024
1 parent 1a8a77d commit 5bc06c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/models/test_histogram_saving.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,12 +1482,11 @@ def mock_save_workspace(name, filepath): # pylint: disable=unused-argument
assert config["output_dir"] == "/test/file/path"
assert config["mde_type"] == "Data"


def test_scale_workspace(shiver_app):
"""Test scale workspace"""

histogram_presenter = shiver_app.main_window.histogram_presenter
scale_factor = 3
scale_factor = str(3)
scaled_mde = "scaled_mde"
# clear mantid workspace
mtd.clear()
Expand Down Expand Up @@ -1527,4 +1526,9 @@ def test_scale_workspace(shiver_app):
mdh_orig_intensity = mdh_orig.getSignalArray()[0][0][0]
mdh_scaled_intensity = mdh_scaled.getSignalArray()[0][0][0]

assert mdh_scaled_intensity / mdh_orig_intensity == approx(scale_factor, rel=1e-3)
assert mdh_scaled_intensity / mdh_orig_intensity == approx(float(scale_factor), rel=1e-3)

run = mtd[scaled_mde].getExperimentInfo(0).run()
assert 'MDScale' in run.keys()
assert run['MDScale'].value == float(scale_factor)

0 comments on commit 5bc06c3

Please sign in to comment.