Add unit test for pod-create with invalid bay status
Add unit test for pod-create with invalid bay status Change-Id: I7e32f3f154d04b5fab9373a3a731ba8e4e8c511c Depends-on: Ia8eb30b5e54df9a8f48c71f63ceb9763ce7f385a
This commit is contained in:
@@ -72,6 +72,19 @@ class ShellTest(shell_test_base.TestCommandLineArgument):
|
||||
self._mandatory_arg_error)
|
||||
self.assertFalse(mock_list.called)
|
||||
|
||||
@mock.patch('magnumclient.v1.bays.BayManager.get')
|
||||
@mock.patch('magnumclient.v1.pods.PodManager.create')
|
||||
def test_pod_create_failure_invalid_bay_status(self, mock_list, mock_get):
|
||||
mockbay = mock.MagicMock()
|
||||
mockbay.status = "CREATE_IN_PROGRESS"
|
||||
mock_get.return_value = mockbay
|
||||
self._test_arg_failure('pod-create '
|
||||
'--bay xxx '
|
||||
'--manifest test '
|
||||
'--manifest-url test_url',
|
||||
self._bay_status_error)
|
||||
self.assertFalse(mock_list.called)
|
||||
|
||||
@mock.patch('magnumclient.v1.pods.PodManager.delete')
|
||||
def test_pod_delete_success(self, mock_delete):
|
||||
self._test_arg_success('pod-delete xxx --bay zzz')
|
||||
|
||||
Reference in New Issue
Block a user