Exemple #1
0
 def test_getState(self):
     item = MockItem(1, 'a', 'a', 'a', '1')
     _id = 1
     name = "test"
     r = Room(_id, name)
     r.addItem(1, item)
     self.assertEqual(r.getState(), [{'id': 1, 'state': 1}])
Exemple #2
0
 def test_getState(self):
     item = MockItem(1, 'a', 'a', 'a', '1')
     _id = 1
     name = "test"
     r = Room(_id, name)
     r.addItem(1, item)
     self.assertEqual(r.getState(),  [{'id': 1, 'state': 1}])
Exemple #3
0
 def test_getStrucutre(self):
     item = MockItem(1, 'a', 'a', 'a', '1')
     _id = 1
     name = "test"
     r = Room(_id, name)
     r.addItem(1, item)
     self.assertEqual(r.getStructure(), {'id': 1, 'name': "test", 'items': [{'id': 1, 'name': 'a', 'itemType': 'a', 'brand': 'a', 'ip': '1', 'state' : 1}]})
Exemple #4
0
 def test_addItem(self):
     item = MockItem(1, 'a', 'a', 'a', '1')
     _id = 1
     name = "test"
     r = Room(_id, name)
     r.addItem(1, item)
     self.assertEqual(item, r.items[1])
     self.assertEqual(len(r.items), 1)
Exemple #5
0
 def test_addItem(self):
     item = MockItem(1, 'a', 'a', 'a', '1')
     _id = 1
     name = "test"
     r = Room(_id, name)
     r.addItem(1, item)
     self.assertEqual(item, r.items[1])
     self.assertEqual(len(r.items), 1)
Exemple #6
0
 def test_getStrucutre(self):
     item = MockItem(1, 'a', 'a', 'a', '1')
     _id = 1
     name = "test"
     r = Room(_id, name)
     r.addItem(1, item)
     self.assertEqual(
         r.getStructure(), {
             'id':
             1,
             'name':
             "test",
             'items': [{
                 'id': 1,
                 'name': 'a',
                 'itemType': 'a',
                 'brand': 'a',
                 'ip': '1',
                 'state': 1
             }]
         })