def test_direction_and_value_of_pin_is_reset_when_closed(self):
    with pins.pin(0, Out) as pin:
        pin.value = 1
    gpio_admin('export', 17, PullDown)
    try:
        assert (content_of('/sys/class/gpio/gpio17/value') == '0\n')
        assert (content_of('/sys/class/gpio/gpio17/direction') == 'in\n')
    finally:
        gpio_admin('unexport', 17)
def test_direction_and_value_of_pin_is_reset_when_closed(self):
    with pins.pin(0, Out) as pin:
        pin.value = 1
    gpio_admin('export', 17, PullDown)
    try:
        assert (content_of('/sys/class/gpio/gpio17/value') == '0\n')
        assert (content_of('/sys/class/gpio/gpio17/direction') == 'in\n')
    finally:
        gpio_admin('unexport', 17)