def test_run_deploy_json2(self): usage_stdout = StringIO() with contextlib.redirect_stdout(usage_stdout): modules.deploy(region=region, stack=stack, app=app, custom_json=custom_json) output = usage_stdout.getvalue().strip() self.assertIn('deploy main function', output)
def test_deploy(self): with patch('boto3.client') as mock_client: with patch('boto3.client.create_deployment' ) as boto_create_deployment: with patch('boto3.client.describe_instances' ) as boto_describe_instances: with open('test/json_data/describe_instances.json' ) as json_file: data = json.load(json_file) boto_create_deployment.return_value = "{ 'DeploymentId': 'DEPLOYMENTID' }" boto_describe_instances.return_value = data modules.deploy('eu-west-1', 'STACKID', 'LAYERID', 'APPID') self.assertEqual(mock_client.call_count, 3)