Skip to content

Commit 51b66a5

Browse files
committed
fixed gpio test
1 parent 9730db3 commit 51b66a5

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

tests/test_gpio.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def test_gpio_library_available():
1717

1818
#Test 2: confirm pins can switch HIGH/ LOW
1919
def test_gpio_high_low():
20+
2021
test_pin = 17
2122
GPIO.setup(test_pin, GPIO.OUT)
2223

23-
2424
GPIO.output(test_pin, GPIO.HIGH)
2525
time.sleep(0.1)
2626
assert GPIO.input(test_pin) == GPIO.HIGH
@@ -29,7 +29,6 @@ def test_gpio_high_low():
2929
time.sleep(0.1)
3030
assert GPIO.input(test_pin) == GPIO.LOW
3131

32-
# GPIO.cleanup()
3332

3433
#Test 3: confirm you can read a state -> Loopback
3534
def test_gpio_loopback():
@@ -40,19 +39,16 @@ def test_gpio_loopback():
4039
GPIO.setup(out_pin, GPIO.OUT)
4140
GPIO.setup(in_pin, GPIO.IN)
4241

43-
GPIO.input(in_pin) == GPIO.HIGH
44-
time.sleep(0.1)
4542
GPIO.output(out_pin, GPIO.HIGH)
43+
time.sleep(0.1)
4644
assert GPIO.input(in_pin) == GPIO.HIGH
4745

48-
GPIO.input(in_pin) == GPIO.LOW
49-
time.sleep(0.1)
5046
GPIO.output(out_pin, GPIO.LOW)
47+
time.sleep(0.1)
5148
assert GPIO.input(in_pin) == GPIO.LOW
5249

53-
# GPIO.cleanup()
5450

5551
#Test 4: CAN FD HAT specific GPIO test
5652
@pytest.mark.skip("Requires CAN FD HAT")
5753
def test_can_hat_gpio():
58-
pass
54+
pass

0 commit comments

Comments
 (0)