diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 10:42:56 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 12:07:41 +0100 |
commit | 55a1ee445c98ca0f1c9b1bc52b210eb983df077e (patch) | |
tree | 9d093cfc79df263c3b6ec3a7187e62b781ccd3cd /tests | |
parent | 7b616f381e4c1ef705b03195215b3b230b455b07 (diff) | |
download | telepathy-salut-55a1ee445c98ca0f1c9b1bc52b210eb983df077e.tar.gz |
ContactInfo: expose fake FN field
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/avahi/aliases.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/twisted/avahi/aliases.py b/tests/twisted/avahi/aliases.py index 6ce3ba3c..ace67be4 100644 --- a/tests/twisted/avahi/aliases.py +++ b/tests/twisted/avahi/aliases.py @@ -30,11 +30,18 @@ def assertOmitsField(field_name, fields): assertLength(0, filter(matches, fields)) def check_contact_info(info, txt): - if '1st' in txt or 'last' in txt: - values = [txt.get('last', ''), txt.get('1st', ''), '', '', ''] + first = txt.get('1st', None) + last = txt.get('last', None) + + if first or last: + values = [last or '', first or '', '', '', ''] assertContains(('n', [], values), info) + + fn = ' '.join([ x for x in [first, last] if x is not None]) + assertContains(('fn', [], [fn]), info) else: assertOmitsField('n', info) + assertOmitsField('fn', info) if 'email' in txt: assertContains(('email', ['type=internet'], [txt['email']]), info) @@ -69,9 +76,11 @@ def test(q, bus, conn): assertEquals(cs.CONTACT_INFO_FLAG_PUSH, ci_props['ContactInfoFlags']) assertEquals( [ ('n', [], cs.CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT, 1), + ('fn', [], cs.CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT, 1), ('email', ['type=internet'], cs.CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT, 1), ('x-jabber', [], cs.CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT, 1), + ], ci_props['SupportedFields']) |