Beispiel #1
0
 def test_210_controller_to_dict(self):
     try:
         nodes = self.network.controller.to_dict()
         self.assertEqual(type(nodes), type(dict()))
         res = json_dumps(nodes)
     except TypeError:
         res = None
     self.assertNotEqual(res, None)
Beispiel #2
0
 def test_020_scene_to_dict(self):
     scenes = self.network.get_scenes()
     for scene in scenes:
         try:
             scene = scenes[scene].to_dict()
             self.assertEqual(type(scene), type(dict()))
             res = json_dumps(scene)
         except TypeError:
             res = None
         self.assertNotEqual(res, None)
Beispiel #3
0
 def test_220_nodes_groups_to_dict(self):
     for node in self.active_nodes:
         try:
             groups = self.active_nodes[node].groups_to_dict()
             self.assertTrue(type(groups), type(dict()))
             self.assertEqual(type(groups), type(dict()))
             res = json_dumps(groups)
         except TypeError:
             res = None
         self.assertNotEqual(res, None)
Beispiel #4
0
 def test_200_nodes_to_dict(self):
     for node in self.active_nodes:
         try:
             noded = self.active_nodes[node].to_dict()
             self.assertEqual(type(noded), type(dict()))
             self.assertTrue('values' in noded)
             self.assertTrue('groups' in noded)
             self.assertTrue('neighbors' in noded)
             self.assertTrue('capabilities' in noded)
             res = json_dumps(noded)
         except TypeError:
             res = None
         self.assertNotEqual(res, None)
Beispiel #5
0
 def test_200_values_to_dict(self):
     for node in self.active_nodes:
         for value in self.active_nodes[node].values:
             val = self.active_nodes[node].values[value].to_dict()
             print(val)
             self.assertEqual(type(val), type(dict()))
             self.assertTrue('data_items' in val)
             self.assertTrue('command_class' in val)
             self.assertTrue('is_read_only' in val)
             self.assertTrue('is_write_only' in val)
             self.assertTrue('type' in val)
             self.assertTrue('index' in val)
             res = json_dumps(val)
             self.assertNotEqual(res, None)
Beispiel #6
0
 def test_010_scenes_to_dict(self):
     dscenes = self.network.scenes_to_dict()
     self.assertEqual(type(dscenes), type(dict()))
     res = json_dumps(dscenes)
     self.assertNotEqual(res, None)
     self.assertTrue(len(res) > 0)
Beispiel #7
0
 def test_220_network_nodes_to_dict(self):
     dnodes = self.network.nodes_to_dict()
     self.assertEqual(type(dnodes), type(dict()))
     res = json_dumps(dnodes)
     self.assertNotEqual(res, None)
     self.assertTrue(len(res) > 0)
Beispiel #8
0
 def test_200_network_to_dict(self):
     dnetwork = self.network.to_dict()
     self.assertEqual(type(dnetwork), type(dict()))
     res = json_dumps(dnetwork)
     self.assertNotEqual(res, None)
     self.assertTrue(len(res) > 0)