def setUp(self): properties = { 'info.udi' : 'foo/bar/computer' } self.head = haltree.HalDevice(properties) properties = { 'info.udi' : 'foo/bar/disk/3', 'info.parent' : 'foo/bar/computer' } self.child = haltree.HalDevice(properties)
def test_with_parent(self): parent_udi = 'foo/bar/parent/1' properties = { 'info.udi' : 'foo/bar/disk/3', 'info.parent' : parent_udi } device = haltree.HalDevice(properties) self.assertEquals(parent_udi, device.parent_udi)
def test_no_parent(self): properties = { 'info.udi' : 'foo/bar/disk/3' } device = haltree.HalDevice(properties) self.assertEquals(None, device.parent_udi)