def test_setting_org_in_different_ways_for_refactoring(self): vcard1 = create_test_vcard() vcard2 = create_test_vcard() wrapper1 = VCardWrapper(vcard1) wrapper2 = VCardWrapper(vcard2) wrapper1._add_organisation('foo') wrapper2._add_organisation(['foo']) self.assertEqual(wrapper1.organisations, wrapper2.organisations)
def test_setting_and_getting_organisations(self): # also test that organisations are returned in sorted order vcard = create_test_vcard() wrapper = VCardWrapper(vcard) org1 = ["Org", "Sub1", "Sub2"] org2 = ["Org2", "Sub3"] org3 = ["Foo", "Bar", "Baz"] wrapper._add_organisation(org1) wrapper._add_organisation(org2) wrapper._add_organisation(org3) self.assertListEqual(wrapper.organisations, [org3, org1, org2])
def test_setting_fn_from_labelled_org(self): vcard = create_test_vcard() wrapper = VCardWrapper(vcard) wrapper._delete_vcard_object("FN") wrapper._add_organisation({'Work': ['Test Inc']}) self.assertEqual(wrapper.formatted_name, 'Test Inc')