def test_phaselist2dict(self, phase_list): pl_dict = phaselist2dict(phase_list) this_dict = {"hello": "there"} this_dict = phaselist2dict(phase_list, dictionary=this_dict) this_dict.pop("hello") assert_dictionaries_are_equal(pl_dict, this_dict)
def test_dict2phaselist(self, phase_list): phase_list2 = dict2phaselist(phaselist2dict(phase_list)) assert phase_list.size == phase_list2.size assert phase_list.ids == phase_list2.ids assert phase_list.names == phase_list2.names assert phase_list.colors == phase_list2.colors assert [ s1.name == s2.name for s1, s2 in zip(phase_list.point_groups, phase_list2.point_groups) ]