Skip to content

Commit 439f0c0

Browse files
author
Onur R. Bingol
committed
Add all_positive checks in surface generator tests
1 parent 07e5c12 commit 439f0c0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/test_surfgen.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,24 @@ def test_bumps1(grid2):
180180
assert check
181181

182182

183+
def test_bumps1_all_positive_heights(grid2):
184+
grid2.bumps(num_bumps=2, all_positive=True, bump_height=5, base_extent=2)
185+
check_vals = grid2.grid()
186+
187+
check = False
188+
for rows in check_vals:
189+
for val in rows:
190+
# should consider negative values too
191+
if val[2] == 5.0:
192+
check = True
193+
194+
assert check
195+
196+
183197
def test_bumps2(grid2):
184198
with pytest.raises(RuntimeError):
185199
# impossible to add 10 bumps on this specific grid
186-
grid2.bumps(num_bumps=10, all_positive=True, bump_height=5, base_extent=2)
200+
grid2.bumps(num_bumps=10, all_positive=False, bump_height=5, base_extent=2)
187201

188202

189203
def test_bumps3(gridw):

0 commit comments

Comments
 (0)