Explorar o código

Add one more test for crypto.py

oz123 %!s(int64=11) %!d(string=hai) anos
pai
achega
d3971acbf9
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  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()