def test_locked_flag(self): keychain = Keychain(self.data_path) self.assertTrue(keychain.locked) self.assertTrue(keychain.unlock("badger")) self.assertFalse(keychain.locked)
def test_key_by_id(self): keychain = Keychain(self.data_path) key = keychain.key(identifier="525E210E0B4C49799D7E47DD8E789C78") self.assertEquals("525E210E0B4C49799D7E47DD8E789C78", key.identifier) self.assertEquals("SL5", key.level)
def test_key_by_id_with_bad_id(self): keychain = Keychain(self.data_path) key = keychain.key(identifier="not-a-real-key") self.assertIsNone(key)
def test_key_by_security_level(self): keychain = Keychain(self.data_path) key = keychain.key(security_level="SL5") self.assertEqual("525E210E0B4C49799D7E47DD8E789C78", key.identifier) self.assertEqual("SL5", key.level)
def test_key_by_id_with_bad_security_level(self): keychain = Keychain(self.data_path) key = keychain.key(security_level="not-a-real-key") self.assertIsNone(key)
def test_key_by_id(self): keychain = Keychain(self.data_path) key = keychain.key(identifier="525E210E0B4C49799D7E47DD8E789C78") self.assertEqual("525E210E0B4C49799D7E47DD8E789C78", key.identifier) self.assertEqual("SL5", key.level)
def test_key_by_security_level(self): keychain = Keychain(self.data_path) key = keychain.key(security_level="SL5") self.assertEquals("525E210E0B4C49799D7E47DD8E789C78", key.identifier) self.assertEquals("SL5", key.level)