def test_get_accounts(self): from letsencrypt.account import Account accs = Account.get_accounts(self.config) self.assertFalse(accs) self.test_account.save() accs = Account.get_accounts(self.config) self.assertEqual(len(accs), 1) self.assertEqual(accs[0].email, self.test_account.email) acc2 = Account(self.config, self.key, "*****@*****.**") acc2.save() accs = Account.get_accounts(self.config) self.assertEqual(len(accs), 2)
def test_get_accounts_no_accounts(self): from letsencrypt.account import Account self.assertEqual(Account.get_accounts( mock.Mock(accounts_dir="non-existant")), [])