diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-10-23 08:52:49 +0200 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2015-10-26 07:15:26 +0100 |
commit | 46c89176fd7f140d785bbdc399a94daca269172e (patch) | |
tree | a872ab074e900b034597467f4dbbf61a7cf04118 | |
parent | e563de9203be581acc30c7794f568ae40d22bee0 (diff) | |
download | sssd-46c89176fd7f140d785bbdc399a94daca269172e.tar.gz sssd-46c89176fd7f140d785bbdc399a94daca269172e.tar.xz sssd-46c89176fd7f140d785bbdc399a94daca269172e.zip |
intg_tests: Fix PEP8 warnings
Reviewed-by: Michal Židek <mzidek@redhat.com>
-rw-r--r-- | src/tests/intg/ent.py | 28 | ||||
-rw-r--r-- | src/tests/intg/ent_test.py | 14 | ||||
-rw-r--r-- | src/tests/intg/ldap_test.py | 6 |
3 files changed, 25 insertions, 23 deletions
diff --git a/src/tests/intg/ent.py b/src/tests/intg/ent.py index 0fe08dcbd..2d3d02a53 100644 --- a/src/tests/intg/ent.py +++ b/src/tests/intg/ent.py @@ -129,7 +129,7 @@ def _diff(ent, pattern, desc_map={}): items = _get_desc(desc_map, None)[0] + "s" if len(unmatched_pattern) > 0: return "\nexpected " + items + " not found:\n" + \ - pformat(unmatched_pattern) + pformat(unmatched_pattern) elif isinstance(pattern, list): if not isinstance(ent, list): return "not a list, " + str(type(ent)) @@ -153,10 +153,10 @@ def _diff(ent, pattern, desc_map={}): d = "" if len(unmatched_pattern) > 0: d += "\nexpected " + items + " not found:\n" + \ - pformat(unmatched_pattern) + pformat(unmatched_pattern) if len(unmatched_ent) != 0: d += "\nunexpected " + items + " found:\n" + \ - pformat(unmatched_ent) + pformat(unmatched_ent) if len(d) > 0: return d else: @@ -187,13 +187,13 @@ def _convert_passwd(passwd): Convert a passwd entry returned by pwd module to an entry dictionary. """ return dict( - name=passwd.pw_name, - passwd=passwd.pw_passwd, - uid=passwd.pw_uid, - gid=passwd.pw_gid, - gecos=passwd.pw_gecos, - dir=passwd.pw_dir, - shell=passwd.pw_shell + name=passwd.pw_name, + passwd=passwd.pw_passwd, + uid=passwd.pw_uid, + gid=passwd.pw_gid, + gecos=passwd.pw_gecos, + dir=passwd.pw_dir, + shell=passwd.pw_shell ) @@ -350,10 +350,10 @@ def _convert_group(group): Convert a group entry returned by grp module to an entry dictionary. """ return dict( - name=group.gr_name, - passwd=group.gr_passwd, - gid=group.gr_gid, - mem=group.gr_mem + name=group.gr_name, + passwd=group.gr_passwd, + gid=group.gr_gid, + mem=group.gr_mem ) diff --git a/src/tests/intg/ent_test.py b/src/tests/intg/ent_test.py index abba94a24..598930324 100644 --- a/src/tests/intg/ent_test.py +++ b/src/tests/intg/ent_test.py @@ -169,7 +169,7 @@ def test_assert_each_passwd_by_name(users_and_groups): assert False except AssertionError as e: assert str(e) == \ - "user 'user1' mismatch: 'name' mismatch: 'user2' != 'user1'" + "user 'user1' mismatch: 'name' mismatch: 'user2' != 'user1'" def test_assert_each_passwd_by_uid(users_and_groups): @@ -186,7 +186,7 @@ def test_assert_each_passwd_by_uid(users_and_groups): assert False except AssertionError as e: assert str(e) == \ - "user 1001 mismatch: 'uid' mismatch: 1002 != 1001" + "user 1001 mismatch: 'uid' mismatch: 1002 != 1001" def test_assert_each_passwd_with_name(users_and_groups): @@ -203,7 +203,7 @@ def test_assert_each_passwd_with_name(users_and_groups): assert False except AssertionError as e: assert str(e) == \ - "user 'user1' mismatch: 'uid' mismatch: 1002 != 1001" + "user 'user1' mismatch: 'uid' mismatch: 1002 != 1001" def test_assert_each_passwd_with_uid(users_and_groups): @@ -220,7 +220,7 @@ def test_assert_each_passwd_with_uid(users_and_groups): assert False except AssertionError as e: assert str(e) == \ - "user 1001 mismatch: 'name' mismatch: 'user2' != 'user1'" + "user 1001 mismatch: 'name' mismatch: 'user2' != 'user1'" def test_assert_passwd(users_and_groups): @@ -381,7 +381,7 @@ def test_assert_each_group_by_gid(users_and_groups): assert False except AssertionError as e: assert str(e) == \ - "group 2001 mismatch: 'gid' mismatch: 2002 != 2001" + "group 2001 mismatch: 'gid' mismatch: 2002 != 2001" def test_assert_each_group_with_name(users_and_groups): @@ -398,7 +398,7 @@ def test_assert_each_group_with_name(users_and_groups): assert False except AssertionError as e: assert str(e) == \ - "group 'group1' mismatch: 'gid' mismatch: 2002 != 2001" + "group 'group1' mismatch: 'gid' mismatch: 2002 != 2001" def test_assert_each_group_with_gid(users_and_groups): @@ -415,7 +415,7 @@ def test_assert_each_group_with_gid(users_and_groups): assert False except AssertionError as e: assert str(e) == \ - "group 2001 mismatch: 'name' mismatch: 'group2' != 'group1'" + "group 2001 mismatch: 'name' mismatch: 'group2' != 'group1'" def test_assert_group(users_and_groups): diff --git a/src/tests/intg/ldap_test.py b/src/tests/intg/ldap_test.py index 6a09b3725..6d61726b8 100644 --- a/src/tests/intg/ldap_test.py +++ b/src/tests/intg/ldap_test.py @@ -39,8 +39,10 @@ LDAP_BASE_DN = "dc=example,dc=com" def ds_inst(request): """LDAP server instance fixture""" ds_inst = ds_openldap.DSOpenLDAP( - config.PREFIX, 10389, LDAP_BASE_DN, - "cn=admin", "Secret123") + config.PREFIX, 10389, LDAP_BASE_DN, + "cn=admin", "Secret123" + ) + try: ds_inst.setup() except: |