Skip to content

Commit

Permalink
Test invalid energy specification
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Feb 1, 2025
1 parent 3fc3675 commit 073b66c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stingray/tests/test_varenergyspectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def test_no_spectrum_func_raises(self):
with pytest.raises(TypeError):
ref_int = VarEnergySpectrum(self.events, [0.0, 10000], (0.5, 5, 10, "log"), [0.3, 10])

@pytest.mark.parametrize("energy_spec", [2, "a"])
def test_invalid_energy_spec(self, energy_spec):
with pytest.raises(ValueError, match="Energy specification must be a tuple"):
DummyVarEnergy(self.events, [0.0, 10000], energy_spec=2)

def test_ref_band_none(self):
events = EventList(
[0.09, 0.21, 0.23, 0.32, 0.4, 0.54], energy=[0, 0, 0, 0, 1, 1], gti=[[0, 0.65]]
Expand Down

0 comments on commit 073b66c

Please sign in to comment.