Skip to content

Commit ea49dee

Browse files
frozencemeterysimo5
authored andcommitted
Fix Python lines that were too long
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
1 parent 6159fc6 commit ea49dee

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

tests/magtests.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
del(requests_kerberos)
1717

1818
def parse_args():
19-
parser = argparse.ArgumentParser(description='Mod Auth GSSAPI Tests Environment')
19+
parser = argparse.ArgumentParser(
20+
description='Mod Auth GSSAPI Tests Environment')
2021
parser.add_argument('--path', default='%s/scratchdir' % os.getcwd(),
2122
help="Directory in which tests are run")
2223
parser.add_argument('--so-dir', default='%s/src/.libs' % os.getcwd(),
@@ -191,7 +192,7 @@ def setup_wrappers(base):
191192
basicConstraints = critical,CA:FALSE
192193
subjectAltName = otherName:1.3.6.1.5.2.2;SEQUENCE:krb5princ_client
193194
extendedKeyUsage = 1.3.6.1.5.2.3.4
194-
'''
195+
''' # noqa
195196

196197
def setup_test_certs(testdir, testenv, logfile):
197198

@@ -701,8 +702,9 @@ def test_hostname_acceptor(testdir, testenv, logfile):
701702

702703
errs += test_bad_acceptor_name(testdir, testenv, logfile)
703704

704-
if os.path.exists("/usr/lib64/krb5/plugins/preauth/pkinit.so") or \
705-
os.path.exists("/usr/lib/x86_64-linux-gnu/krb5/plugins/preauth/pkinit.so"):
705+
rpm_path = "/usr/lib64/krb5/plugins/preauth/pkinit.so"
706+
deb_path = "/usr/lib/x86_64-linux-gnu/krb5/plugins/preauth/pkinit.so"
707+
if os.path.exists(rpm_path) or os.path.exists(deb_path):
706708
testenv = kinit_certuser(testdir, testenv)
707709
errs += test_required_name_attr(testdir, testenv, logfile)
708710
else:

tests/t_basic_k5_fail_second.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,28 @@
88
if __name__ == '__main__':
99
s = requests.Session()
1010

11-
url = 'http://%s:%s@%s/basic_auth_krb5/' % (os.environ['MAG_USER_NAME'],
12-
os.environ['MAG_USER_PASSWORD'],
13-
os.environ['NSS_WRAPPER_HOSTNAME'])
11+
url = 'http://%s:%s@%s/basic_auth_krb5/' % \
12+
(os.environ['MAG_USER_NAME'],
13+
os.environ['MAG_USER_PASSWORD'],
14+
os.environ['NSS_WRAPPER_HOSTNAME'])
1415
r = s.get(url)
1516
if r.status_code != 200:
1617
raise ValueError('Basic Auth: Failed Authentication')
1718

18-
url = 'http://%s:%s@%s/basic_auth_krb5/' % (os.environ['MAG_USER_NAME_2'],
19-
os.environ['MAG_USER_PASSWORD'],
20-
os.environ['NSS_WRAPPER_HOSTNAME'])
19+
url = 'http://%s:%s@%s/basic_auth_krb5/' % \
20+
(os.environ['MAG_USER_NAME_2'],
21+
os.environ['MAG_USER_PASSWORD'],
22+
os.environ['NSS_WRAPPER_HOSTNAME'])
2123
r = s.get(url)
2224
if r.status_code == 200:
2325
raise ValueError('Basic Auth: Got Success while expecting Error')
2426
if not 'GSS ERROR' in r.text:
2527
raise ValueError('Basic Auth: Expected error variable is missing')
2628

27-
url = 'http://%s:%s@%s/basic_auth_krb5/' % (os.environ['MAG_USER_NAME_2'],
28-
os.environ['MAG_USER_PASSWORD_2'],
29-
os.environ['NSS_WRAPPER_HOSTNAME'])
29+
url = 'http://%s:%s@%s/basic_auth_krb5/' % \
30+
(os.environ['MAG_USER_NAME_2'],
31+
os.environ['MAG_USER_PASSWORD_2'],
32+
os.environ['NSS_WRAPPER_HOSTNAME'])
3033
r = s.get(url)
3134
if r.status_code != 200:
3235
raise ValueError('Basic Auth: Failed Authentication')

tests/t_basic_k5_two_users.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
if __name__ == '__main__':
99
s = requests.Session()
1010

11-
url = 'http://%s:%s@%s/basic_auth_krb5/' % (os.environ['MAG_USER_NAME'],
12-
os.environ['MAG_USER_PASSWORD'],
13-
os.environ['NSS_WRAPPER_HOSTNAME'])
11+
url = 'http://%s:%s@%s/basic_auth_krb5/' % \
12+
(os.environ['MAG_USER_NAME'],
13+
os.environ['MAG_USER_PASSWORD'],
14+
os.environ['NSS_WRAPPER_HOSTNAME'])
1415
r = s.get(url)
1516
if r.status_code != 200:
1617
raise ValueError('Basic Auth Failed')
1718

18-
url = 'http://%s:%s@%s/basic_auth_krb5/' % (os.environ['MAG_USER_NAME_2'],
19-
os.environ['MAG_USER_PASSWORD_2'],
20-
os.environ['NSS_WRAPPER_HOSTNAME'])
19+
url = 'http://%s:%s@%s/basic_auth_krb5/' % \
20+
(os.environ['MAG_USER_NAME_2'],
21+
os.environ['MAG_USER_PASSWORD_2'],
22+
os.environ['NSS_WRAPPER_HOSTNAME'])
2123
r2 = s.get(url)
2224
if r2.status_code != 200:
2325
raise ValueError('Basic Auth failed')

0 commit comments

Comments
 (0)