Exemple #1
0
    def test_device_types_work(self):
        class DummyDevice(Device):
            pass

        class DummyStatemachineDevice(StateMachineDevice):
            pass

        self.assertTrue(is_device(DummyDevice))
        self.assertTrue(is_device(DummyStatemachineDevice))
Exemple #2
0
 def test_arbitrary_types_fail(self):
     self.assertFalse(is_device(type(3.0)))
     self.assertFalse(is_device(DeviceBuilder))
Exemple #3
0
 def test_device_bases_are_ignored(self):
     self.assertFalse(is_device(DeviceBase))
     self.assertFalse(is_device(Device))
     self.assertFalse(is_device(StateMachineDevice))
Exemple #4
0
 def test_not_a_type_returns_false(self):
     self.assertFalse(is_device(0.0))
     self.assertFalse(is_device(None))