Ejemplo n.º 1
0
 def test_adding_preferred_phone_number(self):
     vcard = create_test_vcard()
     wrapper = VCardWrapper(vcard)
     wrapper._add_phone_number('home', '0123456789')
     wrapper._add_phone_number('pref,home', '0987654321')
     self.assertDictEqual(wrapper.phone_numbers, {
         'home': ['0123456789'],
         'home, pref': ['0987654321']
     })
Ejemplo n.º 2
0
 def test_adding_multible_phone_number(self):
     vcard = create_test_vcard()
     wrapper = VCardWrapper(vcard)
     wrapper._add_phone_number('work', '0987654321')
     wrapper._add_phone_number('home', '0123456789')
     wrapper._add_phone_number('home', '0112233445')
     self.assertDictEqual(
         wrapper.phone_numbers,
         # The lists are sorted!
         {
             'home': ['0112233445', '0123456789'],
             'work': ['0987654321']
         })
Ejemplo n.º 3
0
 def test_adding_a_custom_type_phone_number(self):
     vcard = create_test_vcard()
     wrapper = VCardWrapper(vcard)
     wrapper._add_phone_number('custom_type', '0123456789')
     self.assertDictEqual(wrapper.phone_numbers,
                          {'custom_type': ['0123456789']})