From 4e58e25bca383bf0b6d5e502d5b1534e722f4206 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Fri, 10 Jun 2016 12:32:37 +0100 Subject: [PATCH] Revert "Tweak RGBLED tests - increases coverage" --- tests/test_outputs.py | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/tests/test_outputs.py b/tests/test_outputs.py index 3d2303c..444b1d9 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -410,17 +410,7 @@ def test_rgbled_initial_value_nonpwm(): def test_rgbled_initial_bad_value(): r, g, b = (MockPWMPin(i) for i in (1, 2, 3)) with pytest.raises(ValueError): - RGBLED(r, g, b, initial_value=(1.1, 0.2, 0.3)) - with pytest.raises(ValueError): - RGBLED(r, g, b, initial_value=(0.1, 1.2, 0.3)) - with pytest.raises(ValueError): - RGBLED(r, g, b, initial_value=(0.1, 0.2, 1.3)) - with pytest.raises(ValueError): - RGBLED(r, g, b, initial_value=(-0.1, 0.2, 0.3)) - with pytest.raises(ValueError): - RGBLED(r, g, b, initial_value=(0.1, -0.2, 0.3)) - with pytest.raises(ValueError): - RGBLED(r, g, b, initial_value=(0.1, 0.2, -0.3)) + RGBLED(r, g, b, initial_value=(0.1, 0.2, 1.2)) def test_rgbled_initial_bad_value_nonpwm(): r, g, b = (MockPin(i) for i in (1, 2, 3)) @@ -468,9 +458,6 @@ def test_rgbled_bad_value(): with RGBLED(r, g, b) as device: with pytest.raises(ValueError): device.value = (0, -1, 0) - with RGBLED(r, g, b) as device: - with pytest.raises(ValueError): - device.value = (0, 0, -0.5) def test_rgbled_bad_value_nonpwm(): r, g, b = (MockPin(i) for i in (1, 2, 3)) @@ -635,9 +622,7 @@ def test_rgbled_fade_background_nonpwm(): r, g, b = (MockPin(i) for i in (1, 2, 3)) with RGBLED(r, g, b, pwm=False) as device: with pytest.raises(ValueError): - device.blink(0, 0, 0.2, 0, n=2) - with pytest.raises(ValueError): - device.blink(0, 0, 0, 0.2, n=2) + device.blink(0, 0, 0.2, 0.2, n=2) @pytest.mark.skipif(hasattr(sys, 'pypy_version_info'), reason='timing is too random on pypy') @@ -678,9 +663,7 @@ def test_rgbled_fade_foreground_nonpwm(): r, g, b = (MockPin(i) for i in (1, 2, 3)) with RGBLED(r, g, b, pwm=False) as device: with pytest.raises(ValueError): - device.blink(0, 0, 0.2, 0, n=2, background=False) - with pytest.raises(ValueError): - device.blink(0, 0, 0, 0.2, n=2, background=False) + device.blink(0, 0, 0.2, 0.2, n=2, background=False) @pytest.mark.skipif(hasattr(sys, 'pypy_version_info'), reason='timing is too random on pypy') @@ -723,7 +706,7 @@ def test_rgbled_pulse_background_nonpwm(): r, g, b = (MockPin(i) for i in (1, 2, 3)) with RGBLED(r, g, b, pwm=False) as device: with pytest.raises(ValueError): - device.pulse(n=2) + device.pulse(0.2, 0.2, n=2) @pytest.mark.skipif(hasattr(sys, 'pypy_version_info'), reason='timing is too random on pypy') @@ -764,7 +747,7 @@ def test_rgbled_pulse_foreground_nonpwm(): r, g, b = (MockPin(i) for i in (1, 2, 3)) with RGBLED(r, g, b, pwm=False) as device: with pytest.raises(ValueError): - device.pulse(n=2, background=False) + device.pulse(0.2, 0.2, n=2, background=False) def test_rgbled_blink_interrupt(): r, g, b = (MockPWMPin(i) for i in (1, 2, 3))