Skip to content

Commit

Permalink
[rel] bump to 0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
grindsa committed Apr 24, 2022
1 parent 42303f3 commit d0cbf2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion acme_srv/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.20'
__version__ = '0.21'
__dbversion__ = '0.18'
9 changes: 5 additions & 4 deletions test/test_wsgi_acme2certifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,29 +561,30 @@ def test_046_notfound(self):
def test_047_application(self):
""" test application function valid pathinfo """
environ = {'REQUEST_METHOD': 'UNK', 'REMOTE_ADDR': 'REMOTE_ADDR', 'PATH_INFO': 'directory'}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.20"}}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.21"}}
result_func = json.loads(self.application(environ, Mock())[0])
print(result_func)
self.assertTrue(result_expected.items() <= result_func.items())

def test_048_application(self):
""" test application function wrong pathinfo """
environ = {'REQUEST_METHOD': 'UNK', 'REMOTE_ADDR': 'REMOTE_ADDR', 'PATH_INFO': 'unk'}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.20"}}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.21"}}
self.assertEqual([b'{"status": 404, "message": "Not Found", "detail": "Not Found"}'], self.application(environ, Mock()))

@patch('examples.acme2certifier_wsgi.CONFIG', {'Directory': {'url_prefix': 'url_prefix'}})
def test_049_application(self):
""" test application function wrong pathinfo """
environ = {'REQUEST_METHOD': 'UNK', 'REMOTE_ADDR': 'REMOTE_ADDR', 'PATH_INFO': 'url_prefix/directory'}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.20"}}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.21"}}
result_func = json.loads(self.application(environ, Mock())[0])
self.assertTrue(result_expected.items() <= result_func.items())

@patch('examples.acme2certifier_wsgi.CONFIG', {'CAhandler': {'acme_url': 'acme_url'}})
def test_050_application(self):
""" test application function wrong pathinfo """
environ = {'REQUEST_METHOD': 'UNK', 'REMOTE_ADDR': 'REMOTE_ADDR', 'PATH_INFO': 'directory'}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.20"}}
result_expected = {"newAuthz": "http://localhost/acme/new-authz", "newNonce": "http://localhost/acme/newnonce", "newAccount": "http://localhost/acme/newaccount", "newOrder": "http://localhost/acme/neworders", "revokeCert": "http://localhost/acme/revokecert", "keyChange": "http://localhost/acme/key-change", "meta": {"home": "https://github.com/grindsa/acme2certifier", "author": "grindsa <[email protected]>", "name": "acme2certifier", "version": "0.21"}}
result_func = json.loads(self.application(environ, Mock())[0])
self.assertTrue(result_expected.items() <= result_func.items())

Expand Down

0 comments on commit d0cbf2a

Please sign in to comment.