def test_device_types_work(self): class DummyDevice(Device): pass class DummyStatemachineDevice(StateMachineDevice): pass self.assertTrue(is_device(DummyDevice)) self.assertTrue(is_device(DummyStatemachineDevice))
def test_arbitrary_types_fail(self): self.assertFalse(is_device(type(3.0))) self.assertFalse(is_device(DeviceBuilder))
def test_device_bases_are_ignored(self): self.assertFalse(is_device(DeviceBase)) self.assertFalse(is_device(Device)) self.assertFalse(is_device(StateMachineDevice))
def test_not_a_type_returns_false(self): self.assertFalse(is_device(0.0)) self.assertFalse(is_device(None))