Added keyword args to MockFactory.pin

And a few other last minute fixes
This commit is contained in:
Dave Jones
2016-10-23 15:29:55 +01:00
parent 2ecc25f995
commit 945bea4e54
8 changed files with 75 additions and 21 deletions

View File

@@ -85,15 +85,13 @@ def pins(request, pin_factory):
# Why return both pins in a single fixture? If we defined one fixture for
# each pin then pytest will (correctly) test RPiGPIOPin(22) against
# NativePin(27) and so on. This isn't supported, so we don't test it
if pin_factory.__class__.__name__ == 'MockFactory':
test_pin = pin_factory.pin(TEST_PIN, pin_class=MockConnectedPin)
else:
test_pin = pin_factory.pin(TEST_PIN)
input_pin = pin_factory.pin(INPUT_PIN)
input_pin.function = 'input'
input_pin.pull = 'down'
if pin_factory.__class__.__name__ == 'MockFactory':
test_pin.input_pin = input_pin
test_pin = pin_factory.pin(TEST_PIN, pin_class=MockConnectedPin, input_pin=input_pin)
else:
test_pin = pin_factory.pin(TEST_PIN)
def fin():
test_pin.close()
input_pin.close()