Skip to content

Commit 5526ca1

Browse files
committed
check more stuff
1 parent cd5c408 commit 5526ca1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/test_remote_control.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def _generate(self):
4646

4747
def _cross_section(self, kin):
4848
self._lib.crranma4.ntot += 1
49-
return CrossSectionData(inelastic=float(self._lib.crranma4.ntot))
49+
if self.raise_at is not None:
50+
raise ValueError("from raise_at")
51+
return CrossSectionData(inelastic=float(self._lib.crranma4.ntot[0]))
5052

5153
def _set_kinematics(self, kin):
5254
self._kin = kin
@@ -78,7 +80,8 @@ def test_dummy_1(timeout):
7880
assert model.random_state.counter == 5
7981

8082
c = model.cross_section(kin)
81-
assert c.inelastic == 5
83+
assert c.inelastic == 6
84+
assert model.random_state.counter == 6
8285

8386

8487
@pytest.mark.parametrize("timeout", (100, 0))
@@ -121,6 +124,12 @@ def test_dummy_3(timeout):
121124
assert events == expected
122125

123126
assert model.random_state.counter >= 3
127+
prev = int(model.random_state.counter)
128+
129+
with pytest.raises(ValueError):
130+
model.cross_section(kin)
131+
132+
assert model.random_state.counter == prev + 1
124133

125134

126135
@pytest.mark.parametrize("timeout", (100, 0))

0 commit comments

Comments
 (0)