Skip to content

Commit

Permalink
fixing failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexazarh committed Jul 21, 2016
1 parent 89b1d62 commit 877fdb9
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions package/tests/test_aws_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,29 +113,15 @@ def test_prepare_connectivity_invalid_req(self):

self.assertRaises(ValueError, self.aws_shell_api.prepare_connectivity, self.command_context, req)

def test_delete_ami(self):
def test_delete_instance(self):
deployed_model = DeployDataHolder({'vmdetails': {'uid': 'id'}})
remote_resource = Mock()
remote_resource.fullname = 'my ami name'
self.command_context.remote_endpoints = [remote_resource]
self.aws_shell_api.model_parser.convert_app_resource_to_deployed_app = Mock(return_value=deployed_model)
self.aws_shell_api.delete_ami_operation.delete_instance = Mock(return_value=True)

self.aws_shell_api.delete_ami(self.command_context)

self.assertTrue(
self.aws_shell_api.delete_ami_operation.delete_instance.called_with(
self.aws_shell_api.aws_session_manager.get_ec2_session(), 'id'))

def test_delete_ami_delete_resource(self):
deployed_model = DeployDataHolder({'vmdetails': {'uid': 'id'}})
remote_resource = Mock()
remote_resource.fullname = 'my ami name'
self.command_context.remote_endpoints = [remote_resource]
self.aws_shell_api.model_parser.convert_app_resource_to_deployed_app = Mock(return_value=deployed_model)
self.aws_shell_api.delete_ami_operation.delete_instance = Mock(return_value=True)

self.aws_shell_api.delete_ami(self.command_context)
self.aws_shell_api.delete_instance(self.command_context)

self.assertTrue(
self.aws_shell_api.delete_ami_operation.delete_instance.called_with(
Expand Down

0 comments on commit 877fdb9

Please sign in to comment.