コード例 #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'])
コード例 #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'])
コード例 #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'])