def test_lock(self): s = Secret(self.c) s.create(self.TEST_PASSPHRASE, reinitialize=True) s.unlock(self.TEST_PASSPHRASE) self.assertTrue(s.unlocked()) s.lock() self.assertFalse(s.unlocked())
def test_unlock_wrong_pass(self): s = Secret(self.c) s.create(self.TEST_PASSPHRASE, reinitialize=True) self.assertEqual(s.unlock('bar'), SecretStatus.OPENSSL_ERROR)
def test_unlock(self): s = Secret(self.c) s.create(self.TEST_PASSPHRASE, reinitialize=True) self.assertEqual(s.unlock(self.TEST_PASSPHRASE), SecretStatus.OK)