Exemple #1
0
 def test_locked_flag(self):
     keychain = Keychain(self.data_path)
     self.assertTrue(keychain.locked)
     self.assertTrue(keychain.unlock("badger"))
     self.assertFalse(keychain.locked)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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)
Exemple #5
0
 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_locked_flag(self):
     keychain = Keychain(self.data_path)
     self.assertTrue(keychain.locked)
     self.assertTrue(keychain.unlock("badger"))
     self.assertFalse(keychain.locked)
Exemple #7
0
 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)
Exemple #8
0
 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)
Exemple #9
0
 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)
Exemple #10
0
 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)