Пример #1
0
 def test_alias_list_in_dict(self):
     top = Top()
     logging.info("updating nested attribute...")
     top.nested_dict.number = 1
     logging.info("storing refs...")
     ref1 = top.nested_dict
     ref2 = top.nested_dict.nested_list_2
     yorm.update(top)
     assert id(ref1) == id(top.nested_dict)
     assert id(ref2) == id(top.nested_dict.nested_list_2)
Пример #2
0
 def test_alias_list_in_dict(self):
     top = Top()
     logging.info("updating nested attribute...")
     top.nested_dict.number = 1
     logging.info("storing refs...")
     ref1 = top.nested_dict
     ref2 = top.nested_dict.nested_list_2
     yorm.update(top)
     assert id(ref1) == id(top.nested_dict)
     assert id(ref2) == id(top.nested_dict.nested_list_2)
Пример #3
0
 def test_alias_dict_in_list(self):
     top = Top()
     top.nested_list.append(None)
     ref1 = top.nested_list[0]
     ref2 = top.nested_list[0].nested_dict_3
     ref3 = top.nested_list[0].nested_dict_3.nested_list_3
     yorm.update(top)
     assert id(ref1) == id(top.nested_list[0])
     assert id(ref2) == id(top.nested_list[0].nested_dict_3)
     assert id(ref3) == id(top.nested_list[0].nested_dict_3.nested_list_3)
Пример #4
0
 def test_alias_dict_in_list(self):
     top = Top()
     top.nested_list.append(None)
     ref1 = top.nested_list[0]
     ref2 = top.nested_list[0].nested_dict_3
     ref3 = top.nested_list[0].nested_dict_3.nested_list_3
     yorm.update(top)
     assert id(ref1) == id(top.nested_list[0])
     assert id(ref2) == id(top.nested_list[0].nested_dict_3)
     assert id(ref3) == id(top.nested_list[0].nested_dict_3.nested_list_3)