Skip to content

Commit

Permalink
Fix shutter speed tests
Browse files Browse the repository at this point in the history
Widen the scope up to 700000usec, and add one to the top range to
account for a rounding error
  • Loading branch information
waveform80 committed Mar 21, 2015
1 parent a81dbbb commit 114052f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,11 @@ def test_shutter_speed(camera, previewing):
camera.framerate = 1
try:
# When setting shutter speed manually, ensure the actual shutter speed
# is within 50usec of the specified amount
for value in range(0, 200000, 50):
# is within 50usec of the specified amount (the value+1 accounts for
# a rounding error)
for value in range(0, 700000, 50):
camera.shutter_speed = value
assert (value - 50) <= camera.shutter_speed <= value
assert (value - 50) <= camera.shutter_speed <= (value + 1)
# Test the shutter speed clamping by framerate
camera.framerate = 30
assert 33000 <= camera.shutter_speed <= 33333
Expand Down

0 comments on commit 114052f

Please sign in to comment.