def test_09_prop_update(self): p = PropertyTree() p.here = 3.0 p.there.now = 4.0 p.deeper.test.path = 5.0 props = p.properties().keys() p2 = PropertyTree() p2.value = True p2.last = False p2.update(p) print p2 props = p2.properties().keys() self.assertEqual(props,['deeper/test/path', 'there/now','last','value','here']) self.assertEqual(p2.value,True) self.assertEqual(p2.last,False) self.assertEqual(p2.here,3.0) self.assertEqual(p2.there.now,4.0) self.assertEqual(p2.deeper.test.path,5.0)
def test_09_prop_update(self): p = PropertyTree() p.here = 3.0 p.there.now = 4.0 p.deeper.test.path = 5.0 props = p.properties().keys() p2 = PropertyTree() p2.value = True p2.last = False p2.update(p) print p2 props = p2.properties().keys() self.assertEqual(props, ["deeper/test/path", "there/now", "last", "value", "here"]) self.assertEqual(p2.value, True) self.assertEqual(p2.last, False) self.assertEqual(p2.here, 3.0) self.assertEqual(p2.there.now, 4.0) self.assertEqual(p2.deeper.test.path, 5.0)
def test_09_prop_update(self): p = PropertyTree() p.here = 3.0 p.there.now = 4.0 p.deeper.test.path = 5.0 props = list(p.properties().keys()) p2 = PropertyTree() p2.value = True p2.last = False p2.update(p) print(p2) props = list(p2.properties().keys()) # ordering may be different between python 2 and 3 # sort to avoid issues comparing props.sort() self.assertEqual( props, ['deeper/test/path', 'here', 'last', 'there/now', 'value']) self.assertEqual(p2.value, True) self.assertEqual(p2.last, False) self.assertEqual(p2.here, 3.0) self.assertEqual(p2.there.now, 4.0) self.assertEqual(p2.deeper.test.path, 5.0)