Browse Source

Add one more test for crypto.py

oz123 10 năm trước cách đây
mục cha
commit
d3971acbf9
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      pwman/tests/crypto_tests.py

+ 7 - 0
pwman/tests/crypto_tests.py

@@ -40,3 +40,10 @@ class CryptoTest(unittest.TestCase):
         self.assertFalse(isinstance(new_engine, CryptoEngineOld))
         CryptoEngine._instance = None
         old_engine = CryptoEngine.get()
+
+    def test_alive(self):
+        old_engine = CryptoEngine.get()
+        self.assertTrue(old_engine.alive())
+        old_engine._cipher = None
+        self.assertFalse(old_engine.alive())
+        CryptoEngine.get()