mirror of
https://github.com/certbot/certbot.git
synced 2026-06-07 15:52:08 -04:00
assert_called_once -> assertEqual(1, *.call_count)
This commit is contained in:
parent
56d8c60df6
commit
15f443dced
4 changed files with 7 additions and 6 deletions
|
|
@ -503,7 +503,8 @@ class ClientNetworkWithMockedResponseTest(unittest.TestCase):
|
|||
|
||||
def test_head(self):
|
||||
self.assertEqual(self.response, self.net.head('url', 'foo', bar='baz'))
|
||||
self.send_request.assert_called_once('HEAD', 'url', 'foo', bar='baz')
|
||||
self.send_request.assert_called_once_with(
|
||||
'HEAD', 'url', 'foo', bar='baz')
|
||||
|
||||
def test_get(self):
|
||||
self.assertEqual(self.checked_response, self.net.get(
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class ManualAuthenticatorTest(unittest.TestCase):
|
|||
|
||||
resp = challenges.SimpleHTTPResponse(tls=False, path='Zm9v')
|
||||
self.assertEqual([resp], self.auth.perform(self.achalls))
|
||||
mock_raw_input.assert_called_once()
|
||||
self.assertEqual(1, mock_raw_input.call_count)
|
||||
mock_verify.assert_called_with(self.achalls[0].challb, "foo.com", 4430)
|
||||
|
||||
message = mock_stdout.write.mock_calls[0][1][0]
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class CLITest(unittest.TestCase):
|
|||
|
||||
def test_rollback(self):
|
||||
_, _, _, client = self._call(['rollback'])
|
||||
client.rollback.assert_called_once()
|
||||
self.assertEqual(1, client.rollback.call_count)
|
||||
|
||||
_, _, _, client = self._call(['rollback', '--checkpoints', '123'])
|
||||
client.rollback.assert_called_once_with(
|
||||
|
|
@ -53,7 +53,7 @@ class CLITest(unittest.TestCase):
|
|||
|
||||
def test_config_changes(self):
|
||||
_, _, _, client = self._call(['config_changes'])
|
||||
client.view_config_changes.assert_called_once()
|
||||
self.assertEqual(1, client.view_config_changes.call_count)
|
||||
|
||||
def test_plugins(self):
|
||||
flags = ['--init', '--prepare', '--authenticators', '--installers']
|
||||
|
|
|
|||
|
|
@ -80,11 +80,11 @@ class PickPluginTest(unittest.TestCase):
|
|||
def test_default_provided(self):
|
||||
self.default = "foo"
|
||||
self._call()
|
||||
self.reg.filter.assert_called_once()
|
||||
self.assertEqual(1, self.reg.filter.call_count)
|
||||
|
||||
def test_no_default(self):
|
||||
self._call()
|
||||
self.reg.filter.assert_called_once()
|
||||
self.assertEqual(1, self.reg.filter.call_count)
|
||||
|
||||
def test_no_candidate(self):
|
||||
self.assertTrue(self._call() is None)
|
||||
|
|
|
|||
Loading…
Reference in a new issue