from __future__ import (
    unicode_literals,
    absolute_import,
    print_function,
    division,
    )
str = type('')


import pytest

from gpiozero.pins.mock import MockPin
from gpiozero import *


# TODO devices tests!


@@ -204,16 +204,25 @@
 %0A# TODO 
+add more 
 devices 
@@ -229,8 +229,1035 @@
 tests!%0A%0A
+def test_device_no_pin():%0A    with pytest.raises(GPIOPinMissing):%0A        device = GPIODevice()%0A%0Adef test_device_init():%0A    pin = MockPin(2)%0A    device = GPIODevice(pin)%0A    assert not device.closed%0A    assert device.pin == pin%0A%0Adef test_device_init_twice_same_pin():%0A    pin = MockPin(2)%0A    device = GPIODevice(pin)%0A    with pytest.raises(GPIOPinInUse):%0A        device2 = GPIODevice(pin)%0A%0Adef test_device_init_twice_different_pin():%0A    pin = MockPin(2)%0A    device = GPIODevice(pin)%0A    pin2 = MockPin(3)%0A    device2 = GPIODevice(pin2)%0A%0Adef test_device_close():%0A    pin = MockPin(2)%0A    device = GPIODevice(pin)%0A    device.close()%0A    assert device.closed%0A    assert device.pin is None%0A%0Adef test_device_repr():%0A    pin = MockPin(2)%0A    device = GPIODevice(pin)%0A    assert repr(device) == '%3Cgpiozero.GPIODevice object on pin %25s, is_active=False%3E' %25 pin%0A%0Adef test_device_repr_after_close():%0A    pin = MockPin(2)%0A    device = GPIODevice(pin)%0A    device.close()%0A    assert repr(device) == '%3Cgpiozero.GPIODevice object closed%3E'%0A%0A

Add some GPIODevice unit-tests