@@ -0,0 +1,1741 @@
+from debile.master.keyrings import import_pgp, import_ssl%0A%0Aimport os%0Aimport mock%0Aimport unittest%0A%0A%0Aclass KeyringsTestCase(unittest.TestCase):%0A    @mock.patch('debile.master.keyrings.run_command', return_value=('', 0, 0))%0A    def test_import_pgp_raise_value_error(self, mock):%0A        self.assertRaises(ValueError, import_pgp, 'keyring', 'data')%0A%0A%0A    @mock.patch('debile.master.keyrings.run_command',%0A            return_value=('%5BGNUPG:%5D IMPORT_OK KEY 000XXX000', 0, 0))%0A    def test_import_pgp_successful(self, mock):%0A        fingerprint = import_pgp('keyring', 'data')%0A%0A        self.assertEquals(fingerprint, '000XXX000')%0A%0A%0A    @mock.patch('debile.master.keyrings.run_command', return_value=('', 0, 0))%0A    def test_import_ssl_fingerprint_or_subject_is_none(self, mock):%0A        self.assertRaises(ValueError, import_ssl, 'keyring', 'certdata')%0A%0A%0A    @mock.patch('debile.master.keyrings.run_command',%0A            return_value=('subject=CN=cn2', 0, 0))%0A    def test_import_ssl_cn_not_in_subject(self, mock):%0A        self.assertRaises(ValueError, import_ssl, 'keyring', 'certdata', 'cn')%0A%0A%0A    @mock.patch('debile.master.keyrings.run_command',%0A            return_value=('subject=emailAddress=email2', 0, 0))%0A    def test_import_ssl_cn_not_in_subject(self, mock):%0A        self.assertRaises(ValueError, import_ssl, 'keyring', 'certdata', None,%0A                'email')%0A%0A%0A    @mock.patch('debile.master.keyrings.run_command',%0A            return_value=('subject=emailAddress=email2%5CnSHA1 Fingerprint=00XX00',%0A                0, 0))%0A    def test_import_ssl_successful(self, mock):%0A        fingerprint = import_ssl('tests/resources/keyring', 'certdata')%0A        os.remove('tests/resources/keyring')%0A%0A        self.assertEquals(fingerprint, '00XX00')%0A

write some tests