def test_trust(self): """Test trust""" engine = EngineBluew(name='name', version='version') mac = 'xx:xx:xx:xx:xx' self.assertRaises(EngineError, engine.trust, mac=mac) try: engine.trust(mac) except EngineError as exp: self.assertEqual(exp.reason, EngineError.NOT_IMPLEMENTED)
def test_read_attribute(self): """Test read_attribute""" engine = EngineBluew(name='name', version='version') mac = 'xx:xx:xx:xx:xx' self.assertRaises(EngineError, engine.read_attribute, mac=mac, attribute='x') try: engine.read_attribute(mac, 'x') except EngineError as exp: self.assertEqual(exp.reason, EngineError.NOT_IMPLEMENTED)
def test_version_fails(self): """Test that BluewEngine validates the version.""" try: EngineBluew(name='test') except EngineError as exp: self.assertEqual(exp.reason, EngineError.VERSION_NOT_SET) else: self.assertFalse(True)
def test_name_fails(self): """Test that BluewEngine validates the name.""" try: EngineBluew() except EngineError as exp: self.assertEqual(exp.reason, EngineError.NAME_NOT_SET) else: self.assertFalse(True)