assert_called_once -> assertEqual(1, *.call_count)

This commit is contained in:
Jakub Warmuz 2015-07-10 06:42:02 +00:00
parent 56d8c60df6
commit 15f443dced
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA
4 changed files with 7 additions and 6 deletions

View file

@ -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(

View file

@ -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]

View file

@ -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']

View file

@ -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)