summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-08-16 10:42:56 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-08-16 12:07:41 +0100
commit55a1ee445c98ca0f1c9b1bc52b210eb983df077e (patch)
tree9d093cfc79df263c3b6ec3a7187e62b781ccd3cd /tests
parent7b616f381e4c1ef705b03195215b3b230b455b07 (diff)
downloadtelepathy-salut-55a1ee445c98ca0f1c9b1bc52b210eb983df077e.tar.gz
ContactInfo: expose fake FN field
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/avahi/aliases.py13
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'])