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'])
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'])
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'])