Jelajahi Sumber

optimize imports in Test/test_Utility.py

refactor whitspaces in Test/test_Utility.py
Jens Keim 6 tahun lalu
induk
melakukan
d5c5d23a14
1 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 5 5
      code/Test/test_Utility.py

+ 5 - 5
code/Test/test_Utility.py

@@ -7,12 +7,11 @@ import ID2TLib.Utility as Utility
 
 
 class TestUtility(unittest.TestCase):
-
     def test_update_timestamp_no_delay(self):
-        self.assertTrue(100+10/5 >= Utility.update_timestamp(100, 5) >= 100+1/5)
+        self.assertTrue(100 + 10 / 5 >= Utility.update_timestamp(100, 5) >= 100 + 1 / 5)
 
     def test_update_timestamp_with_delay(self):
-        self.assertTrue(100+1/5+10*100 >= Utility.update_timestamp(100, 5, 10) >= 100+1/5+10)
+        self.assertTrue(100 + 1 / 5 + 10 * 100 >= Utility.update_timestamp(100, 5, 10) >= 100 + 1 / 5 + 10)
 
     def test_update_timestamp_comparison(self):
         self.assertTrue(Utility.update_timestamp(100, 5) <= Utility.update_timestamp(100, 5, 10))
@@ -129,7 +128,8 @@ class TestUtility(unittest.TestCase):
         result = Utility.get_rnd_x86_nop(1000, False)
         correct = True
         for byte in result:
-            if byte.to_bytes(1, "little") not in Utility.x86_nops and byte.to_bytes(1, "little") not in Utility.x86_pseudo_nops:
+            if byte.to_bytes(1, "little") not in Utility.x86_nops \
+                    and byte.to_bytes(1, "little") not in Utility.x86_pseudo_nops:
                 correct = False
                 break
         self.assertTrue(correct)
@@ -226,4 +226,4 @@ class TestUtility(unittest.TestCase):
         except SystemExit:
             self.fail()
 
-    # TODO: get_attacker_config Tests
+            # TODO: get_attacker_config Tests