Esempio n. 1
0
class AccountMemoryStorageTest(unittest.TestCase):
    """Tests for letsencrypt.account.AccountMemoryStorage."""
    def setUp(self):
        from letsencrypt.account import AccountMemoryStorage
        self.storage = AccountMemoryStorage()

    def test_it(self):
        account = mock.Mock(id="x")
        self.assertEqual([], self.storage.find_all())
        self.assertRaises(errors.AccountNotFound, self.storage.load, "x")
        self.storage.save(account)
        self.assertEqual([account], self.storage.find_all())
        self.assertEqual(account, self.storage.load("x"))
        self.storage.save(account)
        self.assertEqual([account], self.storage.find_all())
class AccountMemoryStorageTest(unittest.TestCase):
    """Tests for letsencrypt.account.AccountMemoryStorage."""

    def setUp(self):
        from letsencrypt.account import AccountMemoryStorage
        self.storage = AccountMemoryStorage()

    def test_it(self):
        account = mock.Mock(id="x")
        self.assertEqual([], self.storage.find_all())
        self.assertRaises(errors.AccountNotFound, self.storage.load, "x")
        self.storage.save(account)
        self.assertEqual([account], self.storage.find_all())
        self.assertEqual(account, self.storage.load("x"))
        self.storage.save(account)
        self.assertEqual([account], self.storage.find_all())
Esempio n. 3
0
File: le.py Progetto: vfiebig/rpaas
def _main(domains=[], email=None, hosts=[]):
    ns = ConfigNamespace(email)
    config = NamespaceConfig(ns)
    zope.component.provideUtility(config)

    ams = AccountMemoryStorage()
    acc, acme = register(config, ams)

    authenticator = RpaasLeAuthenticator(hosts=hosts, config=config, name='')
    installer = None
    lec = Client(config, acc, authenticator, installer, acme)
    certr, chain, key, _ = lec.obtain_certificate(domains)
    return (OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM,
                                            certr.body),
            crypto_util.dump_pyopenssl_chain(chain), key.pem)
 def setUp(self):
     from letsencrypt.account import AccountMemoryStorage
     self.storage = AccountMemoryStorage()
Esempio n. 5
0
 def setUp(self):
     from letsencrypt.account import AccountMemoryStorage
     self.storage = AccountMemoryStorage()