Exemplo n.º 1
0
 def test_components_disjoint(self):
     d = merge_devices([
         Device(components={'a': ExportedState()}),
         Device(components={'b': ExportedState()})
     ])
     self.assertEqual(d, IDevice(d))
     self.assertEqual(sorted(d.get_components().keys()), ['a', 'b'])
Exemplo n.º 2
0
 def test_components_conflict(self):
     d = merge_devices([
         Device(components={'a': StubComponent()}),
         Device(components={'a': StubComponent()})
     ])
     self.assertEqual(d, IDevice(d))
     self.assertEqual(sorted(d.get_components_dict().iterkeys()), ['0-a', '1-a'])
Exemplo n.º 3
0
 def test_components_conflict(self):
     d = merge_devices([
         Device(components={'a': ExportedState()}),
         Device(components={'a': ExportedState()})
     ])
     self.assertEqual(d, IDevice(d))
     self.assertEqual(sorted(d.get_components().keys()), ['0-a', '1-a'])