Skip to content

Commit

Permalink
Test run_values() method
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Dec 17, 2024
1 parent 8bda932 commit 5c2e52c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions extra_data/tests/test_sourcedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ def test_run_value(mock_spb_raw_run):
value = xgm.run_value('pulseEnergy.conversion.value')
assert isinstance(value, np.float64)

run_dict = xgm.run_values()
assert 'pulseEnergy.conversion.value' in run_dict
assert 'pulseEnergy.conversion.timestamp' in run_dict

values_dict = xgm.run_values(inc_timestamps=False)
assert 'pulseEnergy.conversion' in values_dict
assert 'pulseEnergy.conversion.timestamp' not in values_dict

with pytest.raises(ValueError):
# no run values for instrument sources
am0.run_values()
Expand Down

0 comments on commit 5c2e52c

Please sign in to comment.