diff options
Diffstat (limited to 'ipatests')
-rw-r--r-- | ipatests/test_install/test_updates.py | 26 | ||||
-rw-r--r-- | ipatests/test_integration/tasks.py | 4 | ||||
-rw-r--r-- | ipatests/test_integration/test_caless.py | 2 | ||||
-rw-r--r-- | ipatests/test_ipaserver/test_ldap.py | 8 |
4 files changed, 20 insertions, 20 deletions
diff --git a/ipatests/test_install/test_updates.py b/ipatests/test_install/test_updates.py index c25d74a8a..c8147f244 100644 --- a/ipatests/test_install/test_updates.py +++ b/ipatests/test_install/test_updates.py @@ -112,7 +112,7 @@ class test_update(unittest.TestCase): for item in ('top', 'nsContainer'): self.assertTrue(item in objectclasses) - self.assertEqual(entry.single_value('cn'), 'test') + self.assertEqual(entry.single_value['cn'], 'test') entries = self.ld.get_entries( self.user_dn, self.ld.SCOPE_BASE, 'objectclass=*', ['*']) @@ -123,10 +123,10 @@ class test_update(unittest.TestCase): for item in ('top', 'person', 'posixaccount', 'krbprincipalaux', 'inetuser'): self.assertTrue(item in objectclasses) - self.assertEqual(entry.single_value('loginshell'), '/bin/bash') - self.assertEqual(entry.single_value('sn'), 'User') - self.assertEqual(entry.single_value('uid'), 'tuser') - self.assertEqual(entry.single_value('cn'), 'Test User') + self.assertEqual(entry.single_value['loginshell'], '/bin/bash') + self.assertEqual(entry.single_value['sn'], 'User') + self.assertEqual(entry.single_value['uid'], 'tuser') + self.assertEqual(entry.single_value['cn'], 'Test User') def test_2_update(self): @@ -140,7 +140,7 @@ class test_update(unittest.TestCase): self.user_dn, self.ld.SCOPE_BASE, 'objectclass=*', ['*']) self.assertEqual(len(entries), 1) entry = entries[0] - self.assertEqual(entry.single_value('gecos'), 'Test User') + self.assertEqual(entry.single_value['gecos'], 'Test User') def test_3_update(self): """ @@ -153,7 +153,7 @@ class test_update(unittest.TestCase): self.user_dn, self.ld.SCOPE_BASE, 'objectclass=*', ['*']) self.assertEqual(len(entries), 1) entry = entries[0] - self.assertEqual(entry.single_value('gecos'), 'Test User New') + self.assertEqual(entry.single_value['gecos'], 'Test User New') def test_4_update(self): """ @@ -166,7 +166,7 @@ class test_update(unittest.TestCase): self.user_dn, self.ld.SCOPE_BASE, 'objectclass=*', ['*']) self.assertEqual(len(entries), 1) entry = entries[0] - self.assertEqual(entry.single_value('gecos'), 'Test User New2') + self.assertEqual(entry.single_value['gecos'], 'Test User New2') def test_5_update(self): """ @@ -296,7 +296,7 @@ class test_update(unittest.TestCase): for item in ('top', 'nsContainer'): self.assertTrue(item in objectclasses) - self.assertEqual(entry.single_value('cn'), 'test') + self.assertEqual(entry.single_value['cn'], 'test') entries = self.ld.get_entries( self.user_dn, self.ld.SCOPE_BASE, 'objectclass=*', ['*']) @@ -307,10 +307,10 @@ class test_update(unittest.TestCase): for item in ('top', 'person', 'posixaccount', 'krbprincipalaux', 'inetuser'): self.assertTrue(item in objectclasses) - self.assertEqual(entry.single_value('loginshell'), '/bin/bash') - self.assertEqual(entry.single_value('sn'), 'User') - self.assertEqual(entry.single_value('uid'), 'tuser') - self.assertEqual(entry.single_value('cn'), 'Test User') + self.assertEqual(entry.single_value['loginshell'], '/bin/bash') + self.assertEqual(entry.single_value['sn'], 'User') + self.assertEqual(entry.single_value['uid'], 'tuser') + self.assertEqual(entry.single_value['cn'], 'Test User') # Now delete diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index d30258761..cee547683 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -620,11 +620,11 @@ def wait_for_replication(ldap, timeout=30): filter='(objectclass=nsds5replicationagreement)', attrs_list=[status_attr, progress_attr]) log.debug('Replication agreements: \n%s', _entries_to_ldif(entries)) - if any(not e.single_value(status_attr).startswith('0 ') + if any(not e.single_value[status_attr].startswith('0 ') for e in entries): log.error('Replication error') continue - if any(e.single_value(progress_attr) == 'TRUE' for e in entries): + if any(e.single_value[progress_attr] == 'TRUE' for e in entries): log.debug('Replication in progress (waited %s/%ss)', i, timeout) else: diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py index 9866705bd..87c523a43 100644 --- a/ipatests/test_integration/test_caless.py +++ b/ipatests/test_integration/test_caless.py @@ -313,7 +313,7 @@ class CALessBase(IntegrationTest): ldap = host.ldap_connect() entry = ldap.get_entry(DN(('cn', 'CACert'), ('cn', 'ipa'), ('cn', 'etc'), host.domain.basedn)) - cert_from_ldap = entry.single_value('cACertificate') + cert_from_ldap = entry.single_value['cACertificate'] self.log.debug('CA cert from LDAP on %s:\n%r', host, cert_from_ldap) assert cert_from_ldap == expected_binary_cacrt diff --git a/ipatests/test_ipaserver/test_ldap.py b/ipatests/test_ipaserver/test_ldap.py index 9cd7f90db..3a63799cf 100644 --- a/ipatests/test_ipaserver/test_ldap.py +++ b/ipatests/test_ipaserver/test_ldap.py @@ -253,10 +253,10 @@ class test_LDAPEntry(object): def test_single_value(self): e = self.entry - assert e.single_value('cn') == self.cn1[0] - assert e.single_value('commonname') == self.cn1[0] - assert e.single_value('COMMONNAME', 'default') == self.cn1[0] - assert e.single_value('bad key', 'default') == 'default' + assert e.single_value['cn'] == self.cn1[0] + assert e.single_value['commonname'] == self.cn1[0] + assert e.single_value.get('COMMONNAME', 'default') == self.cn1[0] + assert e.single_value.get('bad key', 'default') == 'default' def test_sync(self): e = self.entry |