aboutsummaryrefslogtreecommitdiff
path: root/src/arm/test_gnunet_arm.py.in
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-10-12 18:16:07 +0000
committerng0 <ng0@n0.is>2019-10-12 18:16:07 +0000
commita5f5e7ed9b07b902af4438d76087e034abcba9b2 (patch)
tree6f376f93f1c785103d0b30f54311a0f61d2bdced /src/arm/test_gnunet_arm.py.in
parent8e827de2a1db34dfe15f5f9da2850ca469b5ecc3 (diff)
downloadgnunet-a5f5e7ed9b07b902af4438d76087e034abcba9b2.tar.gz
gnunet-a5f5e7ed9b07b902af4438d76087e034abcba9b2.zip
format python
Diffstat (limited to 'src/arm/test_gnunet_arm.py.in')
-rw-r--r--src/arm/test_gnunet_arm.py.in26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/arm/test_gnunet_arm.py.in b/src/arm/test_gnunet_arm.py.in
index 1d067b5d9..9605c4eae 100644
--- a/src/arm/test_gnunet_arm.py.in
+++ b/src/arm/test_gnunet_arm.py.in
@@ -56,25 +56,41 @@ def fail(result):
56def end_arm_failer(command, rc, stdo, stde, normal): 56def end_arm_failer(command, rc, stdo, stde, normal):
57 if normal: 57 if normal:
58 if rc != 0: 58 if rc != 0:
59 fail("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) 59 fail(
60 "FAIL: error running {}\nCommand output was:\n{}\n{}".format(
61 command, stdo, stde
62 )
63 )
60 else: 64 else:
61 if rc == 0: 65 if rc == 0:
62 fail("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) 66 fail(
67 "FAIL: expected error while running {}\nCommand output was:\n{}\n{}"
68 .format(command, stdo, stde)
69 )
63 70
64 71
65def print_only_failer(command, rc, stdo, stde, normal): 72def print_only_failer(command, rc, stdo, stde, normal):
66 if normal: 73 if normal:
67 if rc != 0: 74 if rc != 0:
68 print("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) 75 print(
76 "FAIL: error running {}\nCommand output was:\n{}\n{}".format(
77 command, stdo, stde
78 )
79 )
69 sys.exit(1) 80 sys.exit(1)
70 else: 81 else:
71 if rc == 0: 82 if rc == 0:
72 print("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) 83 print(
84 "FAIL: expected error while running {}\nCommand output was:\n{}\n{}"
85 .format(command, stdo, stde)
86 )
73 sys.exit(1) 87 sys.exit(1)
74 88
75 89
76def r_something(to_run, extra_args, failer=None, normal=True, **kw): 90def r_something(to_run, extra_args, failer=None, normal=True, **kw):
77 rc, stdo, stde = sub_run(to_run + extra_args, nofail=True, want_stde=True, **kw) 91 rc, stdo, stde = sub_run(
92 to_run + extra_args, nofail=True, want_stde=True, **kw
93 )
78 if failer is not None: 94 if failer is not None:
79 failer(to_run + extra_args, rc, stdo, stde, normal) 95 failer(to_run + extra_args, rc, stdo, stde, normal)
80 return (rc, stdo, stde) 96 return (rc, stdo, stde)