"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "certbot/tests/account_test.py" between
certbot-0.30.2.tar.gz and certbot-0.31.0.tar.gz

About: Certbot is EFF’s tool to obtain certs from Let’s Encrypt, and optionally auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.

account_test.py  (certbot-0.30.2):account_test.py  (certbot-0.31.0)
skipping to change at line 15 skipping to change at line 15
import shutil import shutil
import stat import stat
import unittest import unittest
import josepy as jose import josepy as jose
import mock import mock
import pytz import pytz
from acme import messages from acme import messages
from certbot import compat
from certbot import errors from certbot import errors
import certbot.tests.util as test_util import certbot.tests.util as test_util
KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem"))
class AccountTest(unittest.TestCase): class AccountTest(unittest.TestCase):
"""Tests for certbot.account.Account.""" """Tests for certbot.account.Account."""
def setUp(self): def setUp(self):
skipping to change at line 113 skipping to change at line 114
new_authzr_uri = "hi" new_authzr_uri = "hi"
self.acc = Account( self.acc = Account(
regr=messages.RegistrationResource( regr=messages.RegistrationResource(
uri=None, body=messages.Registration(), uri=None, body=messages.Registration(),
new_authzr_uri=new_authzr_uri), new_authzr_uri=new_authzr_uri),
key=KEY) key=KEY)
self.mock_client = mock.MagicMock() self.mock_client = mock.MagicMock()
self.mock_client.directory.new_authz = new_authzr_uri self.mock_client.directory.new_authz = new_authzr_uri
def test_init_creates_dir(self): def test_init_creates_dir(self):
self.assertTrue(os.path.isdir(self.config.accounts_dir)) self.assertTrue(os.path.isdir(
compat.underscores_for_unsupported_characters_in_path(self.config.ac
counts_dir)))
@test_util.broken_on_windows @test_util.broken_on_windows
def test_save_and_restore(self): def test_save_and_restore(self):
self.storage.save(self.acc, self.mock_client) self.storage.save(self.acc, self.mock_client)
account_path = os.path.join(self.config.accounts_dir, self.acc.id) account_path = os.path.join(self.config.accounts_dir, self.acc.id)
self.assertTrue(os.path.exists(account_path)) self.assertTrue(os.path.exists(account_path))
for file_name in "regr.json", "meta.json", "private_key.json": for file_name in "regr.json", "meta.json", "private_key.json":
self.assertTrue(os.path.exists( self.assertTrue(os.path.exists(
os.path.join(account_path, file_name))) os.path.join(account_path, file_name)))
self.assertTrue(oct(os.stat(os.path.join( self.assertTrue(oct(os.stat(os.path.join(
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)