mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
add test for new_order for v2
This commit is contained in:
parent
d5a90c5a6e
commit
26bcaff85c
1 changed files with 15 additions and 0 deletions
|
|
@ -161,6 +161,21 @@ class BackwardsCompatibleClientV2Test(ClientTestBase):
|
|||
mock_client().register.assert_called_once_with(self.new_reg)
|
||||
mock_client().agree_to_tos.assert_not_called()
|
||||
|
||||
def test_new_order_v1(self):
|
||||
self.response.json.return_value = DIRECTORY_V1.to_json()
|
||||
with mock.patch('acme.client.Client') as mock_client:
|
||||
client = self._init()
|
||||
|
||||
def test_new_order_v2(self):
|
||||
self.response.json.return_value = DIRECTORY_V2.to_json()
|
||||
mock_csr_pem = mock.MagicMock()
|
||||
with mock.patch('acme.client.ClientV2') as mock_client:
|
||||
client = self._init()
|
||||
client.new_order(mock_csr_pem)
|
||||
mock_client().new_order.assert_called_once_with(mock_csr_pem)
|
||||
|
||||
|
||||
|
||||
|
||||
class ClientTest(ClientTestBase):
|
||||
"""Tests for acme.client.Client."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue