format python
[oweals/gnunet.git] / src / dht / test_dht_tools.py.in
index 2d9379a42e4267a50c7140a9d1b79a4cf9b91bc8..c2f95e4b5122946ae119eb685356da3a2aa49246 100644 (file)
@@ -94,20 +94,34 @@ def r_put(extra_args, **kw):
 def end_arm_failer(command, rc, stdo, stde, normal):
     if normal:
         if rc != 0:
-            fail("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde))
+            fail(
+                "FAIL: error running {}\nCommand output was:\n{}\n{}".format(
+                    command, stdo, stde
+                )
+            )
     else:
         if rc == 0:
-            fail("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde))
+            fail(
+                "FAIL: expected error while running {}\nCommand output was:\n{}\n{}"
+                .format(command, stdo, stde)
+            )
 
 
 def print_only_failer(command, rc, stdo, stde, normal):
     if normal:
         if rc != 0:
-            print("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde))
+            print(
+                "FAIL: error running {}\nCommand output was:\n{}\n{}".format(
+                    command, stdo, stde
+                )
+            )
             cleanup(1)
     else:
         if rc == 0:
-            print("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde))
+            print(
+                "FAIL: expected error while running {}\nCommand output was:\n{}\n{}"
+                .format(command, stdo, stde)
+            )
             cleanup(1)
 
 
@@ -122,10 +136,13 @@ print("PASS")
 time.sleep(1)
 
 print("TEST: Testing get...", end='')
-rc, stdo, stde = r_get(['-k', 'testkey', '-T', '50 ms', '-t', '8'], want_stdo=True, failer=end_arm_failer)
+rc, stdo, stde = r_get(['-k', 'testkey', '-T', '50 ms', '-t', '8'],
+                       want_stdo=True,
+                       failer=end_arm_failer)
 stdo = stdo.decode('utf-8').replace('\r', '').splitlines()
 expect = "Result 0, type 8:\ntestdata".splitlines()
-if len(stdo) != 2 or len(expect) != 2 or stdo[0] != expect[0] or stdo[1] != expect[1]:
+if len(stdo) != 2 or len(expect
+                         ) != 2 or stdo[0] != expect[0] or stdo[1] != expect[1]:
     fail("output `{}' differs from expected `{}'".format(stdo, expect))
 print("PASS")