Fix unit test failure
As some unit tests failed silent before, which not noticed by old mock. So we need fix them to make unit tests right. Closes-Bug: #1473344 Change-Id: Ib2be4270732b1ca04c4d0117be6378b3a31fe83c
This commit is contained in:
parent
de608c2773
commit
c99dd870df
@ -375,7 +375,8 @@ class TestContainerController(db_base.DbTestCase):
|
||||
cmd = {'command': 'ls'}
|
||||
response = self.app.put(url, cmd)
|
||||
self.assertEqual(response.status_int, 200)
|
||||
mock_container_exec.assert_called_one_with(container_uuid, cmd)
|
||||
mock_container_exec.assert_called_once_with(container_uuid,
|
||||
cmd['command'])
|
||||
|
||||
@patch('magnum.conductor.api.API.container_exec')
|
||||
@patch('magnum.objects.Container.get_by_name')
|
||||
@ -391,7 +392,8 @@ class TestContainerController(db_base.DbTestCase):
|
||||
cmd = {'command': 'ls'}
|
||||
response = self.app.put(url, cmd)
|
||||
self.assertEqual(response.status_int, 200)
|
||||
mock_container_exec.assert_called_one_with(container_uuid, cmd)
|
||||
mock_container_exec.assert_called_once_with(container_uuid,
|
||||
cmd['command'])
|
||||
|
||||
@patch('magnum.conductor.api.API.container_delete')
|
||||
@patch('magnum.objects.Container.get_by_uuid')
|
||||
|
@ -99,7 +99,7 @@ class DockerClientTestCase(base.BaseTestCase):
|
||||
client.pause('someid')
|
||||
|
||||
mock_url.assert_called_once_with('/containers/someid/pause')
|
||||
mock_post.assert_callend_once_with(mock_url.return_value)
|
||||
mock_post.assert_called_once_with(mock_url.return_value)
|
||||
mock_raise_for_status.assert_called_once_with(
|
||||
mock_post.return_value)
|
||||
|
||||
@ -113,7 +113,7 @@ class DockerClientTestCase(base.BaseTestCase):
|
||||
client.pause(dict(Id='someid'))
|
||||
|
||||
mock_url.assert_called_once_with('/containers/someid/pause')
|
||||
mock_post.assert_callend_once_with(mock_url.return_value)
|
||||
mock_post.assert_called_once_with(mock_url.return_value)
|
||||
mock_raise_for_status.assert_called_once_with(
|
||||
mock_post.return_value)
|
||||
|
||||
@ -126,7 +126,7 @@ class DockerClientTestCase(base.BaseTestCase):
|
||||
client.unpause('someid')
|
||||
|
||||
mock_url.assert_called_once_with('/containers/someid/unpause')
|
||||
mock_post.assert_callend_once_with(mock_url.return_value)
|
||||
mock_post.assert_called_once_with(mock_url.return_value)
|
||||
mock_raise_for_status.assert_called_once_with(
|
||||
mock_post.return_value)
|
||||
|
||||
@ -140,7 +140,7 @@ class DockerClientTestCase(base.BaseTestCase):
|
||||
client.unpause(dict(Id='someid'))
|
||||
|
||||
mock_url.assert_called_once_with('/containers/someid/unpause')
|
||||
mock_post.assert_callend_once_with(mock_url.return_value)
|
||||
mock_post.assert_called_once_with(mock_url.return_value)
|
||||
mock_raise_for_status.assert_called_once_with(
|
||||
mock_post.return_value)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user