Fixed test for delete_deployment

Due to implementation change, we need to mock the return value.
This commit is contained in:
Jochen Breuer 2017-09-07 10:20:46 +02:00
parent 91076bbafa
commit 20619b24c4
No known key found for this signature in database
GPG Key ID: 29ACE79F4D5EEE69

View File

@ -104,9 +104,9 @@ class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
with patch.dict(kubernetes.__salt__, {'config.option': Mock(return_value="")}):
mock_kubernetes_lib.client.V1DeleteOptions = Mock(return_value="")
mock_kubernetes_lib.client.ExtensionsV1beta1Api.return_value = Mock(
**{"delete_namespaced_deployment.return_value.to_dict.return_value": {}}
**{"delete_namespaced_deployment.return_value.to_dict.return_value": {'code': 200}}
)
self.assertEqual(kubernetes.delete_deployment("test"), {})
self.assertEqual(kubernetes.delete_deployment("test"), {'code': 200})
self.assertTrue(
kubernetes.kubernetes.client.ExtensionsV1beta1Api().
delete_namespaced_deployment().to_dict.called)