@@ -0,0 +1,1672 @@
+# -*- encoding: utf-8 -*-%0A%0Aimport mock%0A%0Afrom awscfncli import cfn%0Afrom click.testing import CliRunner%0A%0A__author__ = 'ray'%0A__date__ = '1/14/17'%0A%0A%0Adef test_cfn_template_validate_with_error():%0A    message = %22%22%22Usage: cfn template validate %5BOPTIONS%5D CONFIG_FILE%0A%0AError: Missing argument %22config_file%22.%0A%22%22%22%0A%0A    runner = CliRunner()%0A    result = runner.invoke(cfn, %5B'template', 'validate'%5D)%0A    assert result.exit_code == 2%0A    assert str(result.output) == message%0A%0A%0Adef test_cfn_template_validate(tmpdir):%0A    with mock.patch('boto3.client', return_value=mock.Mock()) as mock_client:%0A        mock_config = %5C%0A            %22%22%22%0A            Stack:%0A              Region:               us-east-1%0A              StackName:            ExampleStack%0A              TemplateURL:          https://s3.amazonaws.com/example.template%0A            %22%22%22%0A%0A        path = tmpdir.join('config.yml')%0A        path.write(mock_config)%0A%0A        runner = CliRunner()%0A        runner.invoke(cfn, %5B'template', 'validate', path.strpath%5D)%0A%0A        mock_client.return_value.validate_template.assert_called_with(%0A            TemplateURL='https://s3.amazonaws.com/example.template'%0A        )%0A%0A        mock_config = %5C%0A            %22%22%22%0A            Stack:%0A              Region:               us-east-1%0A              StackName:            ExampleStack%0A              TemplateBody:         /example.template%0A            %22%22%22%0A%0A        path = tmpdir.join('config.yml')%0A        path.write(mock_config)%0A%0A        runner = CliRunner()%0A        runner.invoke(cfn, %5B'template', 'validate', path.strpath%5D)%0A%0A        mock_client.return_value.validate_template.assert_called_with(%0A            TemplateBody='/example.template'%0A        )%0A

Add test for template