Skip to content
Snippets Groups Projects
Commit b278dc49 authored by jkerdreu's avatar jkerdreu
Browse files

Added extra check for get_attributes get_description methods, part of the API

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2792 b32b6428-25c9-4566-ad07-03861ab6144f
parent 4e06b39f
No related branches found
No related tags found
No related merge requests found
......@@ -127,6 +127,37 @@ class TestDevice(unittest.TestCase):
self.assertEqual(len(data),1)
self.assertEqual(data["foo"],1)
def test_get_description(self):
dev = new_dev()
dev.vendor_id = 0x1234
dev.product_id = 0x1234
dev.version = '2f'
dev.url = "http://foo.bar"
dev.schema = "http://schemas.foo.bar/schema.json"
dev.info = "FooBar"
dev.hw_id = 0xf12
group = tools.get_random_uuid()
dev.group_id = group
dev.unsupported_methods = ["foo_func"]
dev.unsupported_attributes = ["foo_attr"]
dev.unsupported_notifications = ["foo_notif"]
data = dev._get_description()
self.assertEqual(data["vendor_id"], 0x1234)
self.assertEqual(data["product_id"], 0x1234)
self.assertEqual(data["version"], '2f')
self.assertEqual(data["url"], "http://foo.bar")
self.assertEqual(data["schema"], "http://schemas.foo.bar/schema.json")
self.assertEqual(data["info"], "FooBar")
self.assertEqual(data["hw_id"],0xf12)
self.assertEqual(data["group_id"],group)
self.assertEqual(data["unsupported_methods"],["foo_func"])
self.assertEqual(data["unsupported_notifications"],["foo_notif"])
self.assertEqual(data["unsupported_attributes"],["foo_attr"])
def test_methods(self):
dev = new_dev()
# device has two methods by default
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment