Exemple #1
0
 def check_get_keyid(algo, key_id):
     with tempfile.NamedTemporaryFile(delete=True) as tmpf:
         tmpf.write(algo)
         tmpf.flush()
         result = pkg_integrity.get_keyid(tmpf.name)
         self.assertEqual(result, key_id)
         tmpf.close()
Exemple #2
0
 def test_get_keyid_none(self):
     false_name = '/false/name'
     self.assertTrue(pkg_integrity.get_keyid(false_name) is None)
Exemple #3
0
 def test_get_keyid_none(self):
     """Test get_keyid() when the key name is invalid."""
     false_name = '/false/name'
     self.assertTrue(pkg_integrity.get_keyid(false_name) is None)