diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000000..1bc4951442 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,4 @@ +[run] +branch = True +include = + *src/cfnlint/* diff --git a/.travis.yml b/.travis.yml index d68ac12898..dbf38a7d6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ jobs: - python: 3.5 env: TOXENV=py35 - python: 3.6 - env: TOXENV=py36 + env: TOXENV=py36,codecov - python: 3.7 env: TOXENV=py37 - stage: Integration diff --git a/docs/getting_started/rules.md b/docs/getting_started/rules.md index 7a46e681bb..b24096dc68 100644 --- a/docs/getting_started/rules.md +++ b/docs/getting_started/rules.md @@ -131,7 +131,7 @@ class TestMyNewRule(BaseRuleTestCase): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/mynewrule.yaml', 1) # Amount of expected matches + self.helper_file_negative('test/fixtures/templates/bad/mynewrule.yaml', 1) # Amount of expected matches ``` As you can see `test_file_negative()` in this unit test makes specific use of a CloudFormation template from the Fixtures folder. It's important to provide examples of templates which pass your new rule, and also templates which generate the expected warning/error. diff --git a/test/integration/test_good_templates.py b/test/integration/test_good_templates.py index d284532c1f..c1dfb5ec30 100644 --- a/test/integration/test_good_templates.py +++ b/test/integration/test_good_templates.py @@ -32,35 +32,35 @@ def setUp(self): self.filenames = { 'generic': { - "filename": 'fixtures/templates/good/generic.yaml', + "filename": 'test/fixtures/templates/good/generic.yaml', "failures": 0 }, 'minimal': { - "filename": 'fixtures/templates/good/minimal.yaml', + "filename": 'test/fixtures/templates/good/minimal.yaml', "failures": 0 }, 'transform': { - "filename": 'fixtures/templates/good/transform.yaml', + "filename": 'test/fixtures/templates/good/transform.yaml', "failures": 0 }, 'conditions': { - "filename": 'fixtures/templates/good/conditions.yaml', + "filename": 'test/fixtures/templates/good/conditions.yaml', "failures": 0 }, 'resources_codepipeline': { - 'filename': 'fixtures/templates/good/resources_codepipeline.yaml', + 'filename': 'test/fixtures/templates/good/resources_codepipeline.yaml', 'failures': 0 }, 'transform_serverless_api': { - 'filename': 'fixtures/templates/good/transform_serverless_api.yaml', + 'filename': 'test/fixtures/templates/good/transform_serverless_api.yaml', 'failures': 0 }, 'transform_serverless_function': { - 'filename': 'fixtures/templates/good/transform_serverless_function.yaml', + 'filename': 'test/fixtures/templates/good/transform_serverless_function.yaml', 'failures': 0 }, 'transform_serverless_globals': { - 'filename': 'fixtures/templates/good/transform_serverless_globals.yaml', + 'filename': 'test/fixtures/templates/good/transform_serverless_globals.yaml', 'failures': 0 } } diff --git a/test/integration/test_quickstart_templates.py b/test/integration/test_quickstart_templates.py index f97ff155cc..80677b83e3 100644 --- a/test/integration/test_quickstart_templates.py +++ b/test/integration/test_quickstart_templates.py @@ -33,52 +33,52 @@ def setUp(self): self.filenames = { 'config_rule': { - "filename": 'fixtures/templates/public/lambda-poller.yaml', + "filename": 'test/fixtures/templates/public/lambda-poller.yaml', "failures": 0 }, 'watchmaker': { - "filename": 'fixtures/templates/public/watchmaker.json', + "filename": 'test/fixtures/templates/public/watchmaker.json', "failures": 0 }, 'nist_high_master': { - 'filename': 'fixtures/templates/quickstart/nist_high_master.yaml', - 'results_filename': 'fixtures/results/quickstart/nist_high_master.json' + 'filename': 'test/fixtures/templates/quickstart/nist_high_master.yaml', + 'results_filename': 'test/fixtures/results/quickstart/nist_high_master.json' }, 'nist_application': { - 'filename': 'fixtures/templates/quickstart/nist_application.yaml', - 'results_filename': 'fixtures/results/quickstart/nist_application.json' + 'filename': 'test/fixtures/templates/quickstart/nist_application.yaml', + 'results_filename': 'test/fixtures/results/quickstart/nist_application.json' }, 'nist_config_rules': { - 'filename': 'fixtures/templates/quickstart/nist_config_rules.yaml', - 'results_filename': 'fixtures/results/quickstart/nist_config_rules.json' + 'filename': 'test/fixtures/templates/quickstart/nist_config_rules.yaml', + 'results_filename': 'test/fixtures/results/quickstart/nist_config_rules.json' }, 'nist_iam': { - 'filename': 'fixtures/templates/quickstart/nist_iam.yaml', - 'results_filename': 'fixtures/results/quickstart/nist_iam.json' + 'filename': 'test/fixtures/templates/quickstart/nist_iam.yaml', + 'results_filename': 'test/fixtures/results/quickstart/nist_iam.json' }, 'nist_logging': { - 'filename': 'fixtures/templates/quickstart/nist_logging.yaml', - 'results_filename': 'fixtures/results/quickstart/nist_logging.json' + 'filename': 'test/fixtures/templates/quickstart/nist_logging.yaml', + 'results_filename': 'test/fixtures/results/quickstart/nist_logging.json' }, 'nist_vpc_management': { - 'filename': 'fixtures/templates/quickstart/nist_vpc_management.yaml', - 'results_filename': 'fixtures/results/quickstart/nist_vpc_management.json' + 'filename': 'test/fixtures/templates/quickstart/nist_vpc_management.yaml', + 'results_filename': 'test/fixtures/results/quickstart/nist_vpc_management.json' }, 'nist_vpc_production': { - 'filename': 'fixtures/templates/quickstart/nist_vpc_production.yaml', - 'results_filename': 'fixtures/results/quickstart/nist_vpc_production.json' + 'filename': 'test/fixtures/templates/quickstart/nist_vpc_production.yaml', + 'results_filename': 'test/fixtures/results/quickstart/nist_vpc_production.json' }, 'openshift_master': { - 'filename': 'fixtures/templates/quickstart/openshift_master.yaml', + 'filename': 'test/fixtures/templates/quickstart/openshift_master.yaml', 'failures': 0 }, 'openshift': { - 'filename': 'fixtures/templates/quickstart/openshift.yaml', - 'results_filename': 'fixtures/results/quickstart/openshift.json' + 'filename': 'test/fixtures/templates/quickstart/openshift.yaml', + 'results_filename': 'test/fixtures/results/quickstart/openshift.json' }, 'cis_benchmark': { - 'filename': 'fixtures/templates/quickstart/cis_benchmark.yaml', - 'results_filename': 'fixtures/results/quickstart/cis_benchmark.json' + 'filename': 'test/fixtures/templates/quickstart/cis_benchmark.yaml', + 'results_filename': 'test/fixtures/results/quickstart/cis_benchmark.json' } } diff --git a/test/module/cfn_json/test_cfn_json.py b/test/module/cfn_json/test_cfn_json.py index 1c78cc0eef..31892d8659 100644 --- a/test/module/cfn_json/test_cfn_json.py +++ b/test/module/cfn_json/test_cfn_json.py @@ -35,27 +35,27 @@ def setUp(self): self.filenames = { "config_rule": { - "filename": 'fixtures/templates/quickstart/config-rules.json', + "filename": 'test/fixtures/templates/quickstart/config-rules.json', "failures": 4 }, "iam": { - "filename": 'fixtures/templates/quickstart/iam.json', + "filename": 'test/fixtures/templates/quickstart/iam.json', "failures": 4 }, "nat_instance": { - "filename": 'fixtures/templates/quickstart/nat-instance.json', + "filename": 'test/fixtures/templates/quickstart/nat-instance.json', "failures": 2 }, "vpc_management": { - "filename": 'fixtures/templates/quickstart/vpc-management.json', + "filename": 'test/fixtures/templates/quickstart/vpc-management.json', "failures": 35 }, "vpc": { - "filename": 'fixtures/templates/quickstart/vpc.json', + "filename": 'test/fixtures/templates/quickstart/vpc.json', "failures": 40 }, "poller": { - "filename": 'fixtures/templates/public/lambda-poller.json', + "filename": 'test/fixtures/templates/public/lambda-poller.json', "failures": 0 } } @@ -92,7 +92,7 @@ def test_success_parse_stdin(self): def test_fail_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/json_parse.json' + filename = 'test/fixtures/templates/bad/json_parse.json' try: template = cfnlint.decode.cfn_json.load(filename) diff --git a/test/module/cfn_yaml/test_yaml.py b/test/module/cfn_yaml/test_yaml.py index 07f64bd617..a5e3bb9c34 100644 --- a/test/module/cfn_yaml/test_yaml.py +++ b/test/module/cfn_yaml/test_yaml.py @@ -34,11 +34,11 @@ def setUp(self): self.filenames = { "config_rule": { - "filename": 'fixtures/templates/public/lambda-poller.yaml', + "filename": 'test/fixtures/templates/public/lambda-poller.yaml', "failures": 0 }, "generic_bad": { - "filename": 'fixtures/templates/bad/generic.yaml', + "filename": 'test/fixtures/templates/bad/generic.yaml', "failures": 35 } } diff --git a/test/module/config/test_config_mixin.py b/test/module/config/test_config_mixin.py index 61569937c1..56860e956e 100644 --- a/test/module/config/test_config_mixin.py +++ b/test/module/config/test_config_mixin.py @@ -86,15 +86,15 @@ def test_config_expand_paths(self, yaml_mock): """ Test precedence in """ yaml_mock.side_effect = [ - {'templates': ['fixtures/templates/public/*.yaml']}, + {'templates': ['test/fixtures/templates/public/*.yaml']}, {} ] config = cfnlint.config.ConfigMixIn([]) # test defaults self.assertEqual(config.templates, [ - 'fixtures/templates/public/lambda-poller.yaml', - 'fixtures/templates/public/rds-cluster.yaml']) + 'test/fixtures/templates/public/lambda-poller.yaml', + 'test/fixtures/templates/public/rds-cluster.yaml']) @patch('cfnlint.config.ConfigFileArgs._read_config', create=True) def test_config_expand_paths_failure(self, yaml_mock): diff --git a/test/module/core/test_run_checks.py b/test/module/core/test_run_checks.py index 5c5dee68d7..43caf2a2a0 100644 --- a/test/module/core/test_run_checks.py +++ b/test/module/core/test_run_checks.py @@ -25,7 +25,7 @@ class TestRunChecks(BaseTestCase): def test_good_template(self): """Test success run""" - filename = 'fixtures/templates/good/generic.yaml' + filename = 'test/fixtures/templates/good/generic.yaml' (args, filenames, _) = cfnlint.core.get_args_filenames([ '--template', filename]) @@ -41,7 +41,7 @@ def test_good_template(self): def test_bad_template(self): """Test bad template""" - filename = 'fixtures/templates/quickstart/nat-instance.json' + filename = 'test/fixtures/templates/quickstart/nat-instance.json' (args, filenames, _) = cfnlint.core.get_args_filenames([ '--template', filename]) results = [] @@ -56,7 +56,7 @@ def test_bad_template(self): def test_bad_region(self): """Test bad region""" - filename = 'fixtures/templates/good/generic.yaml' + filename = 'test/fixtures/templates/good/generic.yaml' (args, filenames, _) = cfnlint.core.get_args_filenames(['--template', filename]) (template, rules, _) = cfnlint.core.get_template_rules(filename, args) err = None diff --git a/test/module/core/test_run_cli.py b/test/module/core/test_run_cli.py index 700fb60219..f03ec212f7 100644 --- a/test/module/core/test_run_cli.py +++ b/test/module/core/test_run_cli.py @@ -33,7 +33,7 @@ def tearDown(self): def test_template_not_found(self): """Test template not found""" - filename = 'fixtures/templates/good/core/not_found.yaml' + filename = 'test/fixtures/templates/good/core/not_found.yaml' (args, filenames, _) = cfnlint.core.get_args_filenames( ['--template', filename, '--ignore_bad_template']) @@ -43,7 +43,7 @@ def test_template_not_found(self): def test_template_invalid_yaml(self): """Test template not found""" - filename = 'fixtures/templates/bad/core/config_invalid_yaml.yaml' + filename = 'test/fixtures/templates/bad/core/config_invalid_yaml.yaml' (args, filenames, _) = cfnlint.core.get_args_filenames( ['--template', filename]) @@ -53,7 +53,7 @@ def test_template_invalid_yaml(self): def test_template_invalid_json(self): """Test template not found""" - filename = 'fixtures/templates/bad/core/config_invalid_json.json' + filename = 'test/fixtures/templates/bad/core/config_invalid_json.json' (args, filenames, _) = cfnlint.core.get_args_filenames( ['--template', filename]) @@ -63,7 +63,7 @@ def test_template_invalid_json(self): def test_template_invalid_yaml_ignore(self): """Test template not found""" - filename = 'fixtures/templates/bad/core/config_invalid_yaml.yaml' + filename = 'test/fixtures/templates/bad/core/config_invalid_yaml.yaml' (args, filenames, _) = cfnlint.core.get_args_filenames( ['--template', filename, '--ignore-bad-template']) @@ -73,7 +73,7 @@ def test_template_invalid_yaml_ignore(self): def test_template_invalid_json_ignore(self): """Test template not found""" - filename = 'fixtures/templates/bad/core/config_invalid_json.json' + filename = 'test/fixtures/templates/bad/core/config_invalid_json.json' (args, filenames, _) = cfnlint.core.get_args_filenames( ['--template', filename, '--ignore-bad-template']) @@ -83,7 +83,7 @@ def test_template_invalid_json_ignore(self): def test_template_config(self): """Test template config""" - filename = 'fixtures/templates/good/core/config_parameters.yaml' + filename = 'test/fixtures/templates/good/core/config_parameters.yaml' (args, _, _,) = cfnlint.core.get_args_filenames([ '--template', filename, '--ignore-bad-template']) @@ -97,13 +97,13 @@ def test_template_config(self): self.assertEqual(args.debug, False) self.assertEqual(args.override_spec, None) self.assertEqual(args.regions, ['us-east-1']) - self.assertEqual(args.templates, ['fixtures/templates/good/core/config_parameters.yaml']) + self.assertEqual(args.templates, ['test/fixtures/templates/good/core/config_parameters.yaml']) self.assertEqual(args.update_documentation, False) self.assertEqual(args.update_specs, False) def test_positional_template_parameters(self): """Test overriding parameters""" - filename = 'fixtures/templates/good/core/config_parameters.yaml' + filename = 'test/fixtures/templates/good/core/config_parameters.yaml' (args, _, _) = cfnlint.core.get_args_filenames([ filename, '--ignore-bad-template', '--ignore-checks', 'E0000']) @@ -117,13 +117,13 @@ def test_positional_template_parameters(self): self.assertEqual(args.debug, False) self.assertEqual(args.override_spec, None) self.assertEqual(args.regions, ['us-east-1']) - self.assertEqual(args.templates, ['fixtures/templates/good/core/config_parameters.yaml']) + self.assertEqual(args.templates, ['test/fixtures/templates/good/core/config_parameters.yaml']) self.assertEqual(args.update_documentation, False) self.assertEqual(args.update_specs, False) def test_override_parameters(self): """Test overriding parameters""" - filename = 'fixtures/templates/good/core/config_parameters.yaml' + filename = 'test/fixtures/templates/good/core/config_parameters.yaml' (args, _, _) = cfnlint.core.get_args_filenames([ '--template', filename, '--ignore-bad-template', '--ignore-checks', 'E0000']) @@ -137,14 +137,14 @@ def test_override_parameters(self): self.assertEqual(args.debug, False) self.assertEqual(args.override_spec, None) self.assertEqual(args.regions, ['us-east-1']) - self.assertEqual(args.templates, ['fixtures/templates/good/core/config_parameters.yaml']) + self.assertEqual(args.templates, ['test/fixtures/templates/good/core/config_parameters.yaml']) self.assertEqual(args.update_documentation, False) self.assertEqual(args.update_specs, False) def test_bad_config(self): """ Test bad formatting in config""" - filename = 'fixtures/templates/bad/core/config_parameters.yaml' + filename = 'test/fixtures/templates/bad/core/config_parameters.yaml' (args, _, _) = cfnlint.core.get_args_filenames([ '--template', filename, '--ignore-bad-template']) diff --git a/test/module/override/test_complete.py b/test/module/override/test_complete.py index 7fb15ab680..11adb2c34c 100644 --- a/test/module/override/test_complete.py +++ b/test/module/override/test_complete.py @@ -37,9 +37,9 @@ def tearDown(self): def test_success_run(self): """Success test""" - filename = 'fixtures/templates/good/override/complete.yaml' + filename = 'test/fixtures/templates/good/override/complete.yaml' template = self.load_template(filename) - with open('fixtures/templates/override_spec/complete.json') as fp: + with open('test/fixtures/templates/override_spec/complete.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) @@ -49,10 +49,10 @@ def test_success_run(self): def test_fail_run(self): """Failure test required""" - filename = 'fixtures/templates/bad/override/complete.yaml' + filename = 'test/fixtures/templates/bad/override/complete.yaml' template = self.load_template(filename) - with open('fixtures/templates/override_spec/complete.json') as fp: + with open('test/fixtures/templates/override_spec/complete.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) diff --git a/test/module/override/test_exclude.py b/test/module/override/test_exclude.py index 5961219420..04acf7c5f9 100644 --- a/test/module/override/test_exclude.py +++ b/test/module/override/test_exclude.py @@ -35,9 +35,9 @@ def tearDown(self): def test_success_run(self): """Success test""" - filename = 'fixtures/templates/good/generic.yaml' + filename = 'test/fixtures/templates/good/generic.yaml' template = self.load_template(filename) - with open('fixtures/templates/override_spec/exclude.json') as fp: + with open('test/fixtures/templates/override_spec/exclude.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) @@ -47,10 +47,10 @@ def test_success_run(self): def test_fail_run(self): """Failure test required""" - filename = 'fixtures/templates/bad/override/exclude.yaml' + filename = 'test/fixtures/templates/bad/override/exclude.yaml' template = self.load_template(filename) - with open('fixtures/templates/override_spec/exclude.json') as fp: + with open('test/fixtures/templates/override_spec/exclude.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) diff --git a/test/module/override/test_include.py b/test/module/override/test_include.py index bc97664304..aa0542134b 100644 --- a/test/module/override/test_include.py +++ b/test/module/override/test_include.py @@ -35,10 +35,10 @@ def tearDown(self): def test_fail_run(self): """Failure test required""" - filename = 'fixtures/templates/bad/override/include.yaml' + filename = 'test/fixtures/templates/bad/override/include.yaml' template = self.load_template(filename) - with open('fixtures/templates/override_spec/include.json') as fp: + with open('test/fixtures/templates/override_spec/include.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) diff --git a/test/module/override/test_required.py b/test/module/override/test_required.py index 1006cbaa41..7a4f6ca817 100644 --- a/test/module/override/test_required.py +++ b/test/module/override/test_required.py @@ -35,9 +35,9 @@ def tearDown(self): def test_success_run(self): """Success test""" - filename = 'fixtures/templates/good/override/required.yaml' + filename = 'test/fixtures/templates/good/override/required.yaml' template = self.load_template(filename) - with open('fixtures/templates/override_spec/required.json') as fp: + with open('test/fixtures/templates/override_spec/required.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) @@ -47,9 +47,9 @@ def test_success_run(self): def test_fail_run(self): """Failure test required""" - filename = 'fixtures/templates/bad/override/required.yaml' + filename = 'test/fixtures/templates/bad/override/required.yaml' template = self.load_template(filename) - with open('fixtures/templates/override_spec/required.json') as fp: + with open('test/fixtures/templates/override_spec/required.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) diff --git a/test/module/test_duplicate.py b/test/module/test_duplicate.py index bf9b6f0097..816baa53f7 100644 --- a/test/module/test_duplicate.py +++ b/test/module/test_duplicate.py @@ -35,7 +35,7 @@ def setUp(self): def test_success_run(self): """Test success run""" - filename = 'fixtures/templates/good/generic.yaml' + filename = 'test/fixtures/templates/good/generic.yaml' try: cfnlint.decode.cfn_yaml.load(filename) @@ -51,7 +51,7 @@ def test_fail_json_run(self): def test_fail_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/duplicate.json' + filename = 'test/fixtures/templates/bad/duplicate.json' try: with open(filename) as fp: @@ -65,7 +65,7 @@ def test_fail_run(self): def test_fail_yaml_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/duplicate.yaml' + filename = 'test/fixtures/templates/bad/duplicate.yaml' try: cfnlint.decode.cfn_yaml.load(filename) diff --git a/test/module/test_null_values.py b/test/module/test_null_values.py index 16dc294073..3265a18da2 100644 --- a/test/module/test_null_values.py +++ b/test/module/test_null_values.py @@ -35,7 +35,7 @@ def setUp(self): def test_success_run(self): """Test success run""" - filename = 'fixtures/templates/good/generic.yaml' + filename = 'test/fixtures/templates/good/generic.yaml' try: cfnlint.decode.cfn_yaml.load(filename) @@ -51,7 +51,7 @@ def test_fail_json_run(self): def test_fail_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/null_values.json' + filename = 'test/fixtures/templates/bad/null_values.json' try: with open(filename) as fp: @@ -65,7 +65,7 @@ def test_fail_run(self): def test_fail_yaml_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/null_values.yaml' + filename = 'test/fixtures/templates/bad/null_values.yaml' try: cfnlint.decode.cfn_yaml.load(filename) diff --git a/test/module/test_rules_collections.py b/test/module/test_rules_collections.py index cbe5d90f8d..6b9bd2e081 100644 --- a/test/module/test_rules_collections.py +++ b/test/module/test_rules_collections.py @@ -46,7 +46,7 @@ def test_rule_ids_are_formatted_correctly(self): def test_success_run(self): """ Test Run Logic""" - filename = 'fixtures/templates/good/generic.yaml' + filename = 'test/fixtures/templates/good/generic.yaml' template = cfnlint.decode.cfn_yaml.load(filename) cfn = Template(filename, template, ['us-east-1']) @@ -56,7 +56,7 @@ def test_success_run(self): def test_fail_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/generic.yaml' + filename = 'test/fixtures/templates/bad/generic.yaml' template = cfnlint.decode.cfn_yaml.load(filename) cfn = Template(filename, template, ['us-east-1']) expected_err_count = 35 @@ -66,7 +66,7 @@ def test_fail_run(self): def test_fail_sub_properties_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/properties_onlyone.yaml' + filename = 'test/fixtures/templates/bad/properties_onlyone.yaml' template = cfnlint.decode.cfn_yaml.load(filename) cfn = Template(filename, template, ['us-east-1']) diff --git a/test/module/test_string_template.py b/test/module/test_string_template.py index 43fdf5799b..8d6d7a5389 100644 --- a/test/module/test_string_template.py +++ b/test/module/test_string_template.py @@ -30,7 +30,7 @@ def setUp(self): def test_fail_yaml_run(self): """Test failure run""" - filename = 'fixtures/templates/bad/string.yaml' + filename = 'test/fixtures/templates/bad/string.yaml' _, matches = cfnlint.decode.decode(filename, True) assert len(matches) == 1 diff --git a/test/module/test_template.py b/test/module/test_template.py index dc44569546..d79fedbe81 100644 --- a/test/module/test_template.py +++ b/test/module/test_template.py @@ -22,7 +22,7 @@ class TestTemplate(BaseTestCase): """Test Template Class in cfnlint """ def setUp(self): """ SetUp template object""" - filename = 'fixtures/templates/good/generic.yaml' + filename = 'test/fixtures/templates/good/generic.yaml' template = self.load_template(filename) self.template = Template(filename, template) self.resource_names = [ diff --git a/test/rules/conditions/test_configuration.py b/test/rules/conditions/test_configuration.py index f7a2a352fe..ecbfea9fbe 100644 --- a/test/rules/conditions/test_configuration.py +++ b/test/rules/conditions/test_configuration.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/conditions.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/conditions.yaml', 2) diff --git a/test/rules/conditions/test_exists.py b/test/rules/conditions/test_exists.py index efd45c39bd..e4f5fa749f 100644 --- a/test/rules/conditions/test_exists.py +++ b/test/rules/conditions/test_exists.py @@ -26,7 +26,7 @@ def setUp(self): self.collection.register(Exists()) success_templates = [ - 'fixtures/templates/good/generic.yaml', + 'test/fixtures/templates/good/generic.yaml', ] def test_file_positive(self): @@ -35,4 +35,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/conditions.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/conditions.yaml', 3) diff --git a/test/rules/conditions/test_used.py b/test/rules/conditions/test_used.py index 84cfcdd34e..682b0cf81b 100644 --- a/test/rules/conditions/test_used.py +++ b/test/rules/conditions/test_used.py @@ -26,7 +26,7 @@ def setUp(self): self.collection.register(Used()) success_templates = [ - 'fixtures/templates/good/generic.yaml', + 'test/fixtures/templates/good/generic.yaml', ] def test_file_positive(self): @@ -35,4 +35,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/conditions.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/conditions.yaml', 3) diff --git a/test/rules/functions/test_base64.py b/test/rules/functions/test_base64.py index 0f0e0f9c71..4e3aa57cc2 100644 --- a/test/rules/functions/test_base64.py +++ b/test/rules/functions/test_base64.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_base64.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions_base64.yaml', 1) diff --git a/test/rules/functions/test_cidr.py b/test/rules/functions/test_cidr.py index c86238d394..be54e3cf21 100644 --- a/test/rules/functions/test_cidr.py +++ b/test/rules/functions/test_cidr.py @@ -25,7 +25,7 @@ def setUp(self): super(TestRulesCidr, self).setUp() self.collection.register(Cidr()) self.success_templates = [ - 'fixtures/templates/good/functions_cidr.yaml', + 'test/fixtures/templates/good/functions_cidr.yaml', ] def test_file_positive(self): @@ -34,8 +34,8 @@ def test_file_positive(self): def test_file_positive_extra(self): """Test failure""" - self.helper_file_positive_template('fixtures/templates/good/functions/cidr.yaml') + self.helper_file_positive_template('test/fixtures/templates/good/functions/cidr.yaml') def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_cidr.yaml', 10) + self.helper_file_negative('test/fixtures/templates/bad/functions_cidr.yaml', 10) diff --git a/test/rules/functions/test_dynamic_reference.py b/test/rules/functions/test_dynamic_reference.py index e20aabb7d4..f270a62a81 100644 --- a/test/rules/functions/test_dynamic_reference.py +++ b/test/rules/functions/test_dynamic_reference.py @@ -25,7 +25,7 @@ def setUp(self): super(TestDynamicReferenceSecureString, self).setUp() self.collection.register(DynamicReferenceSecureString()) self.success_templates = [ - 'fixtures/templates/good/functions/dynamic_reference.yaml' + 'test/fixtures/templates/good/functions/dynamic_reference.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/dynamic_reference.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/functions/dynamic_reference.yaml', 2) diff --git a/test/rules/functions/test_find_in_map.py b/test/rules/functions/test_find_in_map.py index 79531aacdb..4bec8ae059 100644 --- a/test/rules/functions/test_find_in_map.py +++ b/test/rules/functions/test_find_in_map.py @@ -25,7 +25,7 @@ def setUp(self): super(TestRulesFindInMap, self).setUp() self.collection.register(FindInMap()) self.success_templates = [ - 'fixtures/templates/good/functions_findinmap.yaml', + 'test/fixtures/templates/good/functions_findinmap.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_findinmap.yaml', 5) + self.helper_file_negative('test/fixtures/templates/bad/functions_findinmap.yaml', 5) diff --git a/test/rules/functions/test_get_att.py b/test/rules/functions/test_get_att.py index 39fd963a26..aebe54e8cc 100644 --- a/test/rules/functions/test_get_att.py +++ b/test/rules/functions/test_get_att.py @@ -25,7 +25,7 @@ def setUp(self): super(TestRulesGetAtt, self).setUp() self.collection.register(GetAtt()) self.success_templates = [ - 'fixtures/templates/good/functions/getatt.yaml' + 'test/fixtures/templates/good/functions/getatt.yaml' ] def test_file_positive(self): @@ -34,8 +34,8 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/generic.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/generic.yaml', 1) def test_file_negative_getatt(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/getatt.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions/getatt.yaml', 1) diff --git a/test/rules/functions/test_getazs.py b/test/rules/functions/test_getazs.py index 30cd24fb3a..36c03c82da 100644 --- a/test/rules/functions/test_getazs.py +++ b/test/rules/functions/test_getazs.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_getaz.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/functions_getaz.yaml', 3) diff --git a/test/rules/functions/test_if.py b/test/rules/functions/test_if.py index ac2550989c..c3a04cb738 100644 --- a/test/rules/functions/test_if.py +++ b/test/rules/functions/test_if.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/if.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions/if.yaml', 1) diff --git a/test/rules/functions/test_join.py b/test/rules/functions/test_join.py index d1d685962d..094581ef9a 100644 --- a/test/rules/functions/test_join.py +++ b/test/rules/functions/test_join.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_join.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/functions_join.yaml', 2) diff --git a/test/rules/functions/test_not.py b/test/rules/functions/test_not.py index 2fc1b12990..7118486589 100644 --- a/test/rules/functions/test_not.py +++ b/test/rules/functions/test_not.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_not.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions_not.yaml', 1) diff --git a/test/rules/functions/test_ref.py b/test/rules/functions/test_ref.py index 012ab799a5..2f6123fff0 100644 --- a/test/rules/functions/test_ref.py +++ b/test/rules/functions/test_ref.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/ref.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions/ref.yaml', 1) diff --git a/test/rules/functions/test_ref_exist.py b/test/rules/functions/test_ref_exist.py index 99c2df97cf..d19bbf6d99 100644 --- a/test/rules/functions/test_ref_exist.py +++ b/test/rules/functions/test_ref_exist.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/ref.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/functions/ref.yaml', 3) diff --git a/test/rules/functions/test_ref_in_condition.py b/test/rules/functions/test_ref_in_condition.py index 9617085843..282c97f934 100644 --- a/test/rules/functions/test_ref_in_condition.py +++ b/test/rules/functions/test_ref_in_condition.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/ref.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions/ref.yaml', 1) diff --git a/test/rules/functions/test_select.py b/test/rules/functions/test_select.py index e618dac9d6..7c67adeeb3 100644 --- a/test/rules/functions/test_select.py +++ b/test/rules/functions/test_select.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_select.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/functions_select.yaml', 3) diff --git a/test/rules/functions/test_split.py b/test/rules/functions/test_split.py index b3e58a1869..591989aa78 100644 --- a/test/rules/functions/test_split.py +++ b/test/rules/functions/test_split.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_split.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/functions_split.yaml', 2) diff --git a/test/rules/functions/test_sub.py b/test/rules/functions/test_sub.py index 4e20433307..d6ffbf3eb2 100644 --- a/test/rules/functions/test_sub.py +++ b/test/rules/functions/test_sub.py @@ -25,7 +25,7 @@ def setUp(self): super(TestRulesSub, self).setUp() self.collection.register(Sub()) self.success_templates = [ - 'fixtures/templates/good/functions_sub.yaml', + 'test/fixtures/templates/good/functions_sub.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions_sub.yaml', 9) + self.helper_file_negative('test/fixtures/templates/bad/functions_sub.yaml', 9) diff --git a/test/rules/functions/test_sub_needed.py b/test/rules/functions/test_sub_needed.py index d2c8aff68c..18a3ee2734 100644 --- a/test/rules/functions/test_sub_needed.py +++ b/test/rules/functions/test_sub_needed.py @@ -25,8 +25,8 @@ def setUp(self): super(TestSubNeeded, self).setUp() self.collection.register(SubNeeded()) self.success_templates = [ - 'fixtures/templates/good/functions_sub.yaml', - 'fixtures/templates/good/functions/sub_needed.yaml', + 'test/fixtures/templates/good/functions_sub.yaml', + 'test/fixtures/templates/good/functions/sub_needed.yaml', ] def test_file_positive(self): @@ -35,4 +35,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/sub_needed.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions/sub_needed.yaml', 1) diff --git a/test/rules/functions/test_sub_parameters_used.py b/test/rules/functions/test_sub_parameters_used.py index 7328f2fc31..3377ac710b 100644 --- a/test/rules/functions/test_sub_parameters_used.py +++ b/test/rules/functions/test_sub_parameters_used.py @@ -25,7 +25,7 @@ def setUp(self): super(TestSubParametersUsed, self).setUp() self.collection.register(SubParametersUsed()) self.success_templates = [ - 'fixtures/templates/good/functions/sub_parameters_used.yaml', + 'test/fixtures/templates/good/functions/sub_parameters_used.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/sub_parameters_used.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions/sub_parameters_used.yaml', 1) diff --git a/test/rules/functions/test_sub_unneeded.py b/test/rules/functions/test_sub_unneeded.py index 6de1d654d1..2708466597 100644 --- a/test/rules/functions/test_sub_unneeded.py +++ b/test/rules/functions/test_sub_unneeded.py @@ -25,7 +25,7 @@ def setUp(self): super(TestSubUnneeded, self).setUp() self.collection.register(SubUnneeded()) self.success_templates = [ - 'fixtures/templates/good/functions_sub.yaml', + 'test/fixtures/templates/good/functions_sub.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/functions/sub_unneeded.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/functions/sub_unneeded.yaml', 1) diff --git a/test/rules/mappings/test_configuration.py b/test/rules/mappings/test_configuration.py index 5e800a499f..d5f0977a93 100644 --- a/test/rules/mappings/test_configuration.py +++ b/test/rules/mappings/test_configuration.py @@ -25,7 +25,7 @@ def setUp(self): super(TestMappingConfiguration, self).setUp() self.collection.register(Configuration()) self.success_templates = [ - 'fixtures/templates/good/mappings/configuration.yaml' + 'test/fixtures/templates/good/mappings/configuration.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/mappings/configuration.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/mappings/configuration.yaml', 3) diff --git a/test/rules/mappings/test_key_name.py b/test/rules/mappings/test_key_name.py index 442edd8721..5089743433 100644 --- a/test/rules/mappings/test_key_name.py +++ b/test/rules/mappings/test_key_name.py @@ -25,7 +25,7 @@ def setUp(self): super(TestKeyName, self).setUp() self.collection.register(KeyName()) self.success_templates = [ - 'fixtures/templates/good/mappings/key_name.yaml' + 'test/fixtures/templates/good/mappings/key_name.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/mappings/key_name.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/mappings/key_name.yaml', 3) diff --git a/test/rules/mappings/test_limitattributes.py b/test/rules/mappings/test_limitattributes.py index 1d05352e5a..ed93e37ed3 100644 --- a/test/rules/mappings/test_limitattributes.py +++ b/test/rules/mappings/test_limitattributes.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_numbers.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_numbers.yaml', 1) diff --git a/test/rules/mappings/test_limitname.py b/test/rules/mappings/test_limitname.py index d754853fcb..3f8df50e54 100644 --- a/test/rules/mappings/test_limitname.py +++ b/test/rules/mappings/test_limitname.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_name.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_name.yaml', 1) diff --git a/test/rules/mappings/test_limitnumber.py b/test/rules/mappings/test_limitnumber.py index 4e584588eb..57460c0cf2 100644 --- a/test/rules/mappings/test_limitnumber.py +++ b/test/rules/mappings/test_limitnumber.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_numbers.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_numbers.yaml', 1) diff --git a/test/rules/mappings/test_name.py b/test/rules/mappings/test_name.py index a79450e3d1..c805215e68 100644 --- a/test/rules/mappings/test_name.py +++ b/test/rules/mappings/test_name.py @@ -25,7 +25,7 @@ def setUp(self): super(TestName, self).setUp() self.collection.register(Name()) self.success_templates = [ - 'fixtures/templates/good/mappings/name.yaml' + 'test/fixtures/templates/good/mappings/name.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/mappings/name.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/mappings/name.yaml', 1) diff --git a/test/rules/mappings/test_used.py b/test/rules/mappings/test_used.py index f319316712..0cf7e74f74 100644 --- a/test/rules/mappings/test_used.py +++ b/test/rules/mappings/test_used.py @@ -26,8 +26,8 @@ def setUp(self): self.collection.register(Used()) success_templates = [ - 'fixtures/templates/good/functions_findinmap.yaml', - 'fixtures/templates/good/mappings/used.yaml' + 'test/fixtures/templates/good/functions_findinmap.yaml', + 'test/fixtures/templates/good/mappings/used.yaml' ] def test_file_positive(self): @@ -36,4 +36,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/mappings/used.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/mappings/used.yaml', 1) diff --git a/test/rules/metadata/test_interface_configuration.py b/test/rules/metadata/test_interface_configuration.py index b935bd30c2..4a1e8a16ff 100644 --- a/test/rules/metadata/test_interface_configuration.py +++ b/test/rules/metadata/test_interface_configuration.py @@ -32,4 +32,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/metadata_interface.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/metadata_interface.yaml', 2) diff --git a/test/rules/metadata/test_interface_parameter_exists.py b/test/rules/metadata/test_interface_parameter_exists.py index e5b75f2f02..448b4753a3 100644 --- a/test/rules/metadata/test_interface_parameter_exists.py +++ b/test/rules/metadata/test_interface_parameter_exists.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/metadata_interface.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/metadata_interface.yaml', 2) diff --git a/test/rules/outputs/test_configuration.py b/test/rules/outputs/test_configuration.py index 4b6834010b..af7043e09f 100644 --- a/test/rules/outputs/test_configuration.py +++ b/test/rules/outputs/test_configuration.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/outputs.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/outputs.yaml', 1) diff --git a/test/rules/outputs/test_description.py b/test/rules/outputs/test_description.py index d4d0a9b765..84ee413298 100644 --- a/test/rules/outputs/test_description.py +++ b/test/rules/outputs/test_description.py @@ -25,7 +25,7 @@ def setUp(self): super(TestDescription, self).setUp() self.collection.register(Description()) self.success_templates = [ - 'fixtures/templates/good/outputs/description.yaml', + 'test/fixtures/templates/good/outputs/description.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/outputs/description.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/outputs/description.yaml', 1) diff --git a/test/rules/outputs/test_importvalue.py b/test/rules/outputs/test_importvalue.py index e0d74bee4a..31d3dc7d2b 100644 --- a/test/rules/outputs/test_importvalue.py +++ b/test/rules/outputs/test_importvalue.py @@ -25,7 +25,7 @@ def setUp(self): super(TestOutputImportValue, self).setUp() self.collection.register(ImportValue()) self.success_templates = [ - 'fixtures/templates/good/outputs/importvalue.yaml', + 'test/fixtures/templates/good/outputs/importvalue.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/outputs.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/outputs.yaml', 1) diff --git a/test/rules/outputs/test_limit_description.py b/test/rules/outputs/test_limit_description.py index b1e1527a02..a1f5b6e57b 100644 --- a/test/rules/outputs/test_limit_description.py +++ b/test/rules/outputs/test_limit_description.py @@ -25,7 +25,7 @@ def setUp(self): super(TestLimitDescription, self).setUp() self.collection.register(LimitDescription()) self.success_templates = [ - 'fixtures/templates/good/outputs/description.yaml', + 'test/fixtures/templates/good/outputs/description.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/outputs/description.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/outputs/description.yaml', 1) diff --git a/test/rules/outputs/test_limitname.py b/test/rules/outputs/test_limitname.py index e69cb45849..8ea6a1a5f4 100644 --- a/test/rules/outputs/test_limitname.py +++ b/test/rules/outputs/test_limitname.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_name.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_name.yaml', 1) diff --git a/test/rules/outputs/test_limitnumber.py b/test/rules/outputs/test_limitnumber.py index ba427d5f15..5c77ee8228 100644 --- a/test/rules/outputs/test_limitnumber.py +++ b/test/rules/outputs/test_limitnumber.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_numbers.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_numbers.yaml', 1) diff --git a/test/rules/outputs/test_name.py b/test/rules/outputs/test_name.py index 7902764de6..cfe641041a 100644 --- a/test/rules/outputs/test_name.py +++ b/test/rules/outputs/test_name.py @@ -25,7 +25,7 @@ def setUp(self): super(TestName, self).setUp() self.collection.register(Name()) self.success_templates = [ - 'fixtures/templates/good/outputs/name.yaml' + 'test/fixtures/templates/good/outputs/name.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/outputs/name.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/outputs/name.yaml', 1) diff --git a/test/rules/outputs/test_required.py b/test/rules/outputs/test_required.py index 2703e9a0bd..43efbc8596 100644 --- a/test/rules/outputs/test_required.py +++ b/test/rules/outputs/test_required.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/outputs.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/outputs.yaml', 3) diff --git a/test/rules/outputs/test_value.py b/test/rules/outputs/test_value.py index 5bf8e7d895..5c8243178e 100644 --- a/test/rules/outputs/test_value.py +++ b/test/rules/outputs/test_value.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/outputs.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/outputs.yaml', 3) diff --git a/test/rules/parameters/test_availability_zone.py b/test/rules/parameters/test_availability_zone.py index d55e5e3138..ef44853029 100644 --- a/test/rules/parameters/test_availability_zone.py +++ b/test/rules/parameters/test_availability_zone.py @@ -26,7 +26,7 @@ def setUp(self): self.collection.register(AvailabilityZone()) success_templates = [ - 'fixtures/templates/good/properties_ec2_vpc.yaml', + 'test/fixtures/templates/good/properties_ec2_vpc.yaml', ] def test_file_positive(self): @@ -35,4 +35,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/parameters_az.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/parameters_az.yaml', 3) diff --git a/test/rules/parameters/test_cidr.py b/test/rules/parameters/test_cidr.py index e10ffb5717..fdd96df882 100644 --- a/test/rules/parameters/test_cidr.py +++ b/test/rules/parameters/test_cidr.py @@ -26,7 +26,7 @@ def setUp(self): self.collection.register(Cidr()) success_templates = [ - 'fixtures/templates/good/functions_cidr.yaml', + 'test/fixtures/templates/good/functions_cidr.yaml', ] def test_file_positive(self): @@ -35,16 +35,16 @@ def test_file_positive(self): def test_file_negative_nist_app(self): """Failure test""" - self.helper_file_negative('fixtures/templates/quickstart/nist_application.yaml', 2) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_application.yaml', 2) def test_file_negative_nist_mgmt(self): """Failure test""" - self.helper_file_negative('fixtures/templates/quickstart/nist_vpc_management.yaml', 6) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_vpc_management.yaml', 6) def test_file_negative_nist_prod(self): """Failure test""" - self.helper_file_negative('fixtures/templates/quickstart/nist_vpc_production.yaml', 9) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_vpc_production.yaml', 9) def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_ec2_network.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/properties_ec2_network.yaml', 1) diff --git a/test/rules/parameters/test_cidr_allowed_values.py b/test/rules/parameters/test_cidr_allowed_values.py index 106ae79fec..ad5743c1e9 100644 --- a/test/rules/parameters/test_cidr_allowed_values.py +++ b/test/rules/parameters/test_cidr_allowed_values.py @@ -26,7 +26,7 @@ def setUp(self): self.collection.register(CidrAllowedValues()) success_templates = [ - 'fixtures/templates/good/properties_ec2_vpc.yaml', + 'test/fixtures/templates/good/properties_ec2_vpc.yaml', ] def test_file_positive(self): @@ -35,4 +35,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_ec2_network.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/properties_ec2_network.yaml', 3) diff --git a/test/rules/parameters/test_configuration.py b/test/rules/parameters/test_configuration.py index 74fe6b4070..4afdbe2634 100644 --- a/test/rules/parameters/test_configuration.py +++ b/test/rules/parameters/test_configuration.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/parameters.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/parameters.yaml', 1) diff --git a/test/rules/parameters/test_default.py b/test/rules/parameters/test_default.py index 82a6ee0b45..5ed080e770 100644 --- a/test/rules/parameters/test_default.py +++ b/test/rules/parameters/test_default.py @@ -30,8 +30,8 @@ def test_file_positive(self): self.helper_file_positive() def test_parameters_success(self): - self.helper_file_positive_template('fixtures/templates/good/parameters/default.yaml') + self.helper_file_positive_template('test/fixtures/templates/good/parameters/default.yaml') def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/parameters/default.yaml', 6) + self.helper_file_negative('test/fixtures/templates/bad/parameters/default.yaml', 6) diff --git a/test/rules/parameters/test_lambda_memory_size.py b/test/rules/parameters/test_lambda_memory_size.py index be6453f256..83d72b6074 100644 --- a/test/rules/parameters/test_lambda_memory_size.py +++ b/test/rules/parameters/test_lambda_memory_size.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_lambda.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/resources_lambda.yaml', 2) diff --git a/test/rules/parameters/test_lambda_runtime.py b/test/rules/parameters/test_lambda_runtime.py index 750ad5a809..727564011c 100644 --- a/test/rules/parameters/test_lambda_runtime.py +++ b/test/rules/parameters/test_lambda_runtime.py @@ -31,4 +31,4 @@ def atest_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_lambda.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_lambda.yaml', 1) diff --git a/test/rules/parameters/test_limitname.py b/test/rules/parameters/test_limitname.py index d4ac2e20cd..4097093677 100644 --- a/test/rules/parameters/test_limitname.py +++ b/test/rules/parameters/test_limitname.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_name.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_name.yaml', 1) diff --git a/test/rules/parameters/test_limitnumber.py b/test/rules/parameters/test_limitnumber.py index e53e327cb9..7a01b34e31 100644 --- a/test/rules/parameters/test_limitnumber.py +++ b/test/rules/parameters/test_limitnumber.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_numbers.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_numbers.yaml', 1) diff --git a/test/rules/parameters/test_limitvalue.py b/test/rules/parameters/test_limitvalue.py index 6581906e65..0736e21691 100644 --- a/test/rules/parameters/test_limitvalue.py +++ b/test/rules/parameters/test_limitvalue.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_parameter_value.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/limit_parameter_value.yaml', 3) diff --git a/test/rules/parameters/test_name.py b/test/rules/parameters/test_name.py index 584056a358..7a4b65ef50 100644 --- a/test/rules/parameters/test_name.py +++ b/test/rules/parameters/test_name.py @@ -25,7 +25,7 @@ def setUp(self): super(TestName, self).setUp() self.collection.register(Name()) self.success_templates = [ - 'fixtures/templates/good/parameters/name.yaml' + 'test/fixtures/templates/good/parameters/name.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/parameters/name.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/parameters/name.yaml', 1) diff --git a/test/rules/parameters/test_security_group.py b/test/rules/parameters/test_security_group.py index dd33ec16fa..c422ee4cda 100644 --- a/test/rules/parameters/test_security_group.py +++ b/test/rules/parameters/test_security_group.py @@ -31,4 +31,4 @@ def atest_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_sg_ingress.yaml', 4) + self.helper_file_negative('test/fixtures/templates/bad/properties_sg_ingress.yaml', 4) diff --git a/test/rules/parameters/test_types.py b/test/rules/parameters/test_types.py index 6afb58da2c..c840fbf5fa 100644 --- a/test/rules/parameters/test_types.py +++ b/test/rules/parameters/test_types.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/parameters.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/parameters.yaml', 1) diff --git a/test/rules/parameters/test_used.py b/test/rules/parameters/test_used.py index 3083a81913..bf8ae20fb8 100644 --- a/test/rules/parameters/test_used.py +++ b/test/rules/parameters/test_used.py @@ -25,7 +25,7 @@ def setUp(self): super(TestParameterUsed, self).setUp() self.collection.register(Used()) self.success_templates = [ - 'fixtures/templates/good/parameters/used_transforms.yaml' + 'test/fixtures/templates/good/parameters/used_transforms.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/parameters.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/parameters.yaml', 3) diff --git a/test/rules/resources/cloudfront/test_aliases.py b/test/rules/resources/cloudfront/test_aliases.py index 510f1c5036..1f34b747ca 100644 --- a/test/rules/resources/cloudfront/test_aliases.py +++ b/test/rules/resources/cloudfront/test_aliases.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative_alias(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_cloudfront_invalid_aliases.yaml', 8) + self.helper_file_negative('test/fixtures/templates/bad/resources_cloudfront_invalid_aliases.yaml', 8) diff --git a/test/rules/resources/codepipeline/test_stageactions.py b/test/rules/resources/codepipeline/test_stageactions.py index 90b819a756..e9302c103c 100644 --- a/test/rules/resources/codepipeline/test_stageactions.py +++ b/test/rules/resources/codepipeline/test_stageactions.py @@ -31,16 +31,16 @@ def test_file_positive(self): def test_file_artifact_counts(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_action_artifact_counts.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_action_artifact_counts.yaml', 1) def test_file_invalid_owner(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_action_invalid_owner.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_action_invalid_owner.yaml', 1) def test_file_invalid_version(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_action_invalid_version.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_action_invalid_version.yaml', 1) def test_file_non_unique(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_action_non_unique.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_action_non_unique.yaml', 1) diff --git a/test/rules/resources/codepipeline/test_stages.py b/test/rules/resources/codepipeline/test_stages.py index 31b95d9fbc..7b353c2eae 100644 --- a/test/rules/resources/codepipeline/test_stages.py +++ b/test/rules/resources/codepipeline/test_stages.py @@ -31,16 +31,16 @@ def test_file_positive(self): def test_file_negative_onestage(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_stages_one_stage.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_stages_one_stage.yaml', 2) def test_file_negative_no_source(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_stages_no_source.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_stages_no_source.yaml', 1) def test_file_negative_second_stage(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_stages_second_stage.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_stages_second_stage.yaml', 1) def test_file_negative_non_unique(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_codepipeline_stages_non_unique.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_codepipeline_stages_non_unique.yaml', 1) diff --git a/test/rules/resources/dynamodb/test_delete_policy.py b/test/rules/resources/dynamodb/test_delete_policy.py index 24a50f7a08..6788a771c7 100644 --- a/test/rules/resources/dynamodb/test_delete_policy.py +++ b/test/rules/resources/dynamodb/test_delete_policy.py @@ -25,7 +25,7 @@ def setUp(self): super(TestTableDeletionPolicy, self).setUp() self.collection.register(TableDeletionPolicy()) self.success_templates = [ - 'fixtures/templates/good/resources/dynamodb/delete_policy.yaml' + 'test/fixtures/templates/good/resources/dynamodb/delete_policy.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative_alias(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/dynamodb/delete_policy.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources/dynamodb/delete_policy.yaml', 1) diff --git a/test/rules/resources/ec2/test_ec2_ebs.py b/test/rules/resources/ec2/test_ec2_ebs.py index c604d72a29..ccadc1bf1e 100644 --- a/test/rules/resources/ec2/test_ec2_ebs.py +++ b/test/rules/resources/ec2/test_ec2_ebs.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_ebs.yaml', 5) + self.helper_file_negative('test/fixtures/templates/bad/properties_ebs.yaml', 5) diff --git a/test/rules/resources/ec2/test_ec2_subnet.py b/test/rules/resources/ec2/test_ec2_subnet.py index 84b38f383d..32ca339283 100644 --- a/test/rules/resources/ec2/test_ec2_subnet.py +++ b/test/rules/resources/ec2/test_ec2_subnet.py @@ -25,7 +25,7 @@ def setUp(self): super(TestPropertyEc2Subnet, self).setUp() self.collection.register(Subnet()) self.success_templates = [ - 'fixtures/templates/good/properties_ec2_vpc.yaml', + 'test/fixtures/templates/good/properties_ec2_vpc.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_ec2_network.yaml', 4) + self.helper_file_negative('test/fixtures/templates/bad/properties_ec2_network.yaml', 4) diff --git a/test/rules/resources/ec2/test_ec2_vpc.py b/test/rules/resources/ec2/test_ec2_vpc.py index b7fb3fb1cf..b8ae2458a8 100644 --- a/test/rules/resources/ec2/test_ec2_vpc.py +++ b/test/rules/resources/ec2/test_ec2_vpc.py @@ -25,7 +25,7 @@ def setUp(self): super(TestPropertyEc2Vpc, self).setUp() self.collection.register(Vpc()) self.success_templates = [ - 'fixtures/templates/good/properties_ec2_vpc.yaml', + 'test/fixtures/templates/good/properties_ec2_vpc.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_ec2_network.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/properties_ec2_network.yaml', 3) diff --git a/test/rules/resources/ec2/test_rt_association.py b/test/rules/resources/ec2/test_rt_association.py index 6e4bfe258b..18208576b7 100644 --- a/test/rules/resources/ec2/test_rt_association.py +++ b/test/rules/resources/ec2/test_rt_association.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_rt_association.yaml', 5) + self.helper_file_negative('test/fixtures/templates/bad/properties_rt_association.yaml', 5) diff --git a/test/rules/resources/ec2/test_sg_description.py b/test/rules/resources/ec2/test_sg_description.py index 3532829538..0c89644add 100644 --- a/test/rules/resources/ec2/test_sg_description.py +++ b/test/rules/resources/ec2/test_sg_description.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_sg_description.yaml', 4) + self.helper_file_negative('test/fixtures/templates/bad/properties_sg_description.yaml', 4) diff --git a/test/rules/resources/ec2/test_sg_ingress.py b/test/rules/resources/ec2/test_sg_ingress.py index 7131fe77ca..fa9c80ee63 100644 --- a/test/rules/resources/ec2/test_sg_ingress.py +++ b/test/rules/resources/ec2/test_sg_ingress.py @@ -25,7 +25,7 @@ def setUp(self): super(TestPropertySgIngress, self).setUp() self.collection.register(SecurityGroupIngress()) self.success_templates = [ - 'fixtures/templates/good/properties_ec2_vpc.yaml', + 'test/fixtures/templates/good/properties_ec2_vpc.yaml', ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_sg_ingress.yaml', 5) + self.helper_file_negative('test/fixtures/templates/bad/properties_sg_ingress.yaml', 5) diff --git a/test/rules/resources/elb/test_elb.py b/test/rules/resources/elb/test_elb.py index ed6edb894a..9ccdbd7de8 100644 --- a/test/rules/resources/elb/test_elb.py +++ b/test/rules/resources/elb/test_elb.py @@ -25,7 +25,7 @@ def setUp(self): super(TestPropertyElb, self).setUp() self.collection.register(Elb()) self.success_templates = [ - 'fixtures/templates/good/properties_elb.yaml' + 'test/fixtures/templates/good/properties_elb.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_elb.yaml', 5) + self.helper_file_negative('test/fixtures/templates/bad/properties_elb.yaml', 5) diff --git a/test/rules/resources/events/test_rule_targets_limit.py b/test/rules/resources/events/test_rule_targets_limit.py index 45dcfe3294..b23fe52218 100644 --- a/test/rules/resources/events/test_rule_targets_limit.py +++ b/test/rules/resources/events/test_rule_targets_limit.py @@ -25,7 +25,7 @@ def setUp(self): super(TestRuleTargetsLimit, self).setUp() self.collection.register(RuleTargetsLimit()) self.success_templates = [ - 'fixtures/templates/good/resources/events/rule_targets_limit.yaml' + 'test/fixtures/templates/good/resources/events/rule_targets_limit.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative_alias(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/events/rule_targets_limit.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources/events/rule_targets_limit.yaml', 1) diff --git a/test/rules/resources/iam/test_iam_instance_profile.py b/test/rules/resources/iam/test_iam_instance_profile.py index a6a71ba050..6aaed3f8ca 100644 --- a/test/rules/resources/iam/test_iam_instance_profile.py +++ b/test/rules/resources/iam/test_iam_instance_profile.py @@ -25,7 +25,7 @@ def setUp(self): super(TestPropertyVpcId, self).setUp() self.collection.register(InstanceProfile()) self.success_templates = [ - 'fixtures/templates/good/resources/iam/instance_profile.yaml' + 'test/fixtures/templates/good/resources/iam/instance_profile.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/generic.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/generic.yaml', 2) diff --git a/test/rules/resources/iam/test_iam_limits.py b/test/rules/resources/iam/test_iam_limits.py index 07267bd92a..f825408efd 100644 --- a/test/rules/resources/iam/test_iam_limits.py +++ b/test/rules/resources/iam/test_iam_limits.py @@ -31,16 +31,16 @@ def test_file_positive(self): def test_managedpolicyarns(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_iam_managedpolicyarns.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/resources_iam_managedpolicyarns.yaml', 3) def test_user_groups(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_iam_user_groups.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_iam_user_groups.yaml', 1) def test_instance_profile_roles(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_iam_instanceprofile_roles.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_iam_instanceprofile_roles.yaml', 1) def test_role_assume_role_policy_document(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_iam_role_assume_role_policy_document.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_iam_role_assume_role_policy_document.yaml', 1) diff --git a/test/rules/resources/iam/test_iam_policy.py b/test/rules/resources/iam/test_iam_policy.py index 089c6f5a0a..1b64bc279b 100644 --- a/test/rules/resources/iam/test_iam_policy.py +++ b/test/rules/resources/iam/test_iam_policy.py @@ -25,8 +25,8 @@ def setUp(self): super(TestPropertyIamPolicies, self).setUp() self.collection.register(Policy()) self.success_templates = [ - 'fixtures/templates/good/resources/iam/policy.yaml', - 'fixtures/templates/good/resources/iam/resource_policy.yaml', + 'test/fixtures/templates/good/resources/iam/policy.yaml', + 'test/fixtures/templates/good/resources/iam/resource_policy.yaml', ] def test_file_positive(self): @@ -35,8 +35,8 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_iam_policy.yaml', 10) + self.helper_file_negative('test/fixtures/templates/bad/properties_iam_policy.yaml', 10) def test_file_resource_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/iam/resource_policy.yaml', 4) + self.helper_file_negative('test/fixtures/templates/bad/resources/iam/resource_policy.yaml', 4) diff --git a/test/rules/resources/iam/test_iam_policy_version.py b/test/rules/resources/iam/test_iam_policy_version.py index dcd4a69f40..4258c16828 100644 --- a/test/rules/resources/iam/test_iam_policy_version.py +++ b/test/rules/resources/iam/test_iam_policy_version.py @@ -25,8 +25,8 @@ def setUp(self): super(TestPolicyVersion, self).setUp() self.collection.register(PolicyVersion()) self.success_templates = [ - 'fixtures/templates/good/resources/iam/resource_policy.yaml', - 'fixtures/templates/good/resources/iam/policy.yaml', + 'test/fixtures/templates/good/resources/iam/resource_policy.yaml', + 'test/fixtures/templates/good/resources/iam/policy.yaml', ] def test_file_positive(self): @@ -35,4 +35,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/iam/policy_version.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources/iam/policy_version.yaml', 1) diff --git a/test/rules/resources/lmbd/test_memory_size.py b/test/rules/resources/lmbd/test_memory_size.py index 8f57d51b44..b73ad4ccc7 100644 --- a/test/rules/resources/lmbd/test_memory_size.py +++ b/test/rules/resources/lmbd/test_memory_size.py @@ -25,7 +25,7 @@ def setUp(self): super(TestFunctionMemorySize, self).setUp() self.collection.register(FunctionMemorySize()) self.success_templates = [ - 'fixtures/templates/good/resources_lambda.yaml' + 'test/fixtures/templates/good/resources_lambda.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_lambda.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/resources_lambda.yaml', 3) diff --git a/test/rules/resources/lmbd/test_runtime.py b/test/rules/resources/lmbd/test_runtime.py index 37facbe615..ff4b65e794 100644 --- a/test/rules/resources/lmbd/test_runtime.py +++ b/test/rules/resources/lmbd/test_runtime.py @@ -25,7 +25,7 @@ def setUp(self): super(TestFunctionRuntime, self).setUp() self.collection.register(FunctionRuntime()) self.success_templates = [ - 'fixtures/templates/good/resources_lambda.yaml' + 'test/fixtures/templates/good/resources_lambda.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_lambda.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources_lambda.yaml', 1) diff --git a/test/rules/resources/properties/test_atleastone.py b/test/rules/resources/properties/test_atleastone.py index 03946e28eb..61110cfc41 100644 --- a/test/rules/resources/properties/test_atleastone.py +++ b/test/rules/resources/properties/test_atleastone.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_atleastone.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/properties_atleastone.yaml', 1) diff --git a/test/rules/resources/properties/test_availability_zone.py b/test/rules/resources/properties/test_availability_zone.py index 7ec2f196f7..7e25becf79 100644 --- a/test/rules/resources/properties/test_availability_zone.py +++ b/test/rules/resources/properties/test_availability_zone.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Failure test""" - self.helper_file_negative('fixtures/templates/bad/properties_az.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/properties_az.yaml', 3) diff --git a/test/rules/resources/properties/test_exclusive.py b/test/rules/resources/properties/test_exclusive.py index a6e6877d01..ae6863c3f0 100644 --- a/test/rules/resources/properties/test_exclusive.py +++ b/test/rules/resources/properties/test_exclusive.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_exclusive.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/properties_exclusive.yaml', 1) diff --git a/test/rules/resources/properties/test_image_id.py b/test/rules/resources/properties/test_image_id.py index e18f0db9fd..772ef52fc8 100644 --- a/test/rules/resources/properties/test_image_id.py +++ b/test/rules/resources/properties/test_image_id.py @@ -27,7 +27,7 @@ def setUp(self): self.collection.register(ImageId()) success_templates = [ - 'fixtures/templates/good/generic.yaml', + 'test/fixtures/templates/good/generic.yaml', ] def test_file_positive(self): @@ -36,12 +36,12 @@ def test_file_positive(self): def test_file_negative_nist_app(self): """Failure test""" - self.helper_file_negative('fixtures/templates/quickstart/nist_application.yaml', 2) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_application.yaml', 2) def test_file_negative_nist_mgmt(self): """Failure test""" - self.helper_file_negative('fixtures/templates/quickstart/nist_vpc_management.yaml', 1) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_vpc_management.yaml', 1) def test_file_negative(self): """Failure test""" - self.helper_file_negative('fixtures/templates/bad/properties_imageid.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/properties_imageid.yaml', 1) diff --git a/test/rules/resources/properties/test_inclusive.py b/test/rules/resources/properties/test_inclusive.py index e07786a61d..417a7d4aef 100644 --- a/test/rules/resources/properties/test_inclusive.py +++ b/test/rules/resources/properties/test_inclusive.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_inclusive.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/properties_inclusive.yaml', 1) diff --git a/test/rules/resources/properties/test_onlyone.py b/test/rules/resources/properties/test_onlyone.py index 6987c8bd13..7d0be6c545 100644 --- a/test/rules/resources/properties/test_onlyone.py +++ b/test/rules/resources/properties/test_onlyone.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_onlyone.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/properties_onlyone.yaml', 2) diff --git a/test/rules/resources/properties/test_password.py b/test/rules/resources/properties/test_password.py index f82cf77831..7692b27706 100644 --- a/test/rules/resources/properties/test_password.py +++ b/test/rules/resources/properties/test_password.py @@ -25,7 +25,7 @@ def setUp(self): super(TestPropertyPassword, self).setUp() self.collection.register(Password()) self.success_templates = [ - 'fixtures/templates/good/resources/properties/password.yaml' + 'test/fixtures/templates/good/resources/properties/password.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_password.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/properties_password.yaml', 3) diff --git a/test/rules/resources/properties/test_properties.py b/test/rules/resources/properties/test_properties.py index 904c409d4b..f85c5e1562 100644 --- a/test/rules/resources/properties/test_properties.py +++ b/test/rules/resources/properties/test_properties.py @@ -27,8 +27,8 @@ def setUp(self): super(TestResourceProperties, self).setUp() self.collection.register(Properties()) self.success_templates = [ - 'fixtures/templates/good/resource_properties.yaml', - 'fixtures/templates/good/resources/properties/templated_code.yaml', + 'test/fixtures/templates/good/resource_properties.yaml', + 'test/fixtures/templates/good/resources/properties/templated_code.yaml', ] def test_file_positive(self): @@ -37,15 +37,15 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/generic.yaml', 9) + self.helper_file_negative('test/fixtures/templates/bad/generic.yaml', 9) def test_file_negative_2(self): """Failure test""" - self.helper_file_negative('fixtures/templates/bad/object_should_be_list.yaml', 4) + self.helper_file_negative('test/fixtures/templates/bad/object_should_be_list.yaml', 4) def test_file_negative_3(self): """Failure test""" - self.helper_file_negative('fixtures/templates/bad/resource_properties.yaml', 4) + self.helper_file_negative('test/fixtures/templates/bad/resource_properties.yaml', 4) class TestSpecifiedCustomResourceProperties(TestResourceProperties): @@ -54,7 +54,7 @@ def setUp(self): """Setup""" super(TestSpecifiedCustomResourceProperties, self).setUp() # Add a Spec override that specifies the Custom::SpecifiedCustomResource type - with open('fixtures/templates/override_spec/custom.json') as fp: + with open('test/fixtures/templates/override_spec/custom.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) # Reset Spec override after test @@ -64,4 +64,4 @@ def setUp(self): def test_file_negative_custom(self): """Additional failure test for specified Custom Resource validation""" - self.helper_file_negative('fixtures/templates/bad/resources/properties/custom.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/resources/properties/custom.yaml', 2) diff --git a/test/rules/resources/properties/test_properties_templated.py b/test/rules/resources/properties/test_properties_templated.py index ecea9819e9..01390b6878 100644 --- a/test/rules/resources/properties/test_properties_templated.py +++ b/test/rules/resources/properties/test_properties_templated.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative_4(self): """Failure test""" - self.helper_file_negative('fixtures/templates/bad/resources/properties/templated_code.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/resources/properties/templated_code.yaml', 1) diff --git a/test/rules/resources/properties/test_required.py b/test/rules/resources/properties/test_required.py index a705cb3016..801fbe8cef 100644 --- a/test/rules/resources/properties/test_required.py +++ b/test/rules/resources/properties/test_required.py @@ -33,11 +33,11 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_required.yaml', 12) + self.helper_file_negative('test/fixtures/templates/bad/properties_required.yaml', 12) def test_file_negative_generic(self): """Generic Test failure""" - self.helper_file_negative('fixtures/templates/bad/generic.yaml', 8) + self.helper_file_negative('test/fixtures/templates/bad/generic.yaml', 8) class TestSpecifiedCustomResourceRequiredProperties(TestResourceConfiguration): @@ -46,7 +46,7 @@ def setUp(self): """Setup""" super(TestSpecifiedCustomResourceRequiredProperties, self).setUp() # Add a Spec override that specifies the Custom::SpecifiedCustomResource type - with open('fixtures/templates/override_spec/custom.json') as fp: + with open('test/fixtures/templates/override_spec/custom.json') as fp: custom_spec = json.load(fp) cfnlint.helpers.set_specs(custom_spec) # Reset Spec override after test @@ -57,4 +57,4 @@ def setUp(self): def test_file_negative(self): """Test failure""" # Additional Custom::SpecifiedCustomResource failure detected with custom spec - self.helper_file_negative('fixtures/templates/bad/properties_required.yaml', 13) + self.helper_file_negative('test/fixtures/templates/bad/properties_required.yaml', 13) diff --git a/test/rules/resources/properties/test_value_primitive_type.py b/test/rules/resources/properties/test_value_primitive_type.py index 80bfb06f44..bd2822d947 100644 --- a/test/rules/resources/properties/test_value_primitive_type.py +++ b/test/rules/resources/properties/test_value_primitive_type.py @@ -26,8 +26,8 @@ def setUp(self): self.collection.register(ValuePrimitiveType()) success_templates = [ - 'fixtures/templates/good/generic.yaml', - 'fixtures/templates/good/resource_properties.yaml' + 'test/fixtures/templates/good/generic.yaml', + 'test/fixtures/templates/good/resource_properties.yaml' ] def test_file_positive(self): @@ -36,16 +36,16 @@ def test_file_positive(self): def test_file_negative_nist_high_master(self): """Generic Test failure""" - self.helper_file_negative('fixtures/templates/quickstart/nist_high_master.yaml', 6) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_high_master.yaml', 6) def test_file_negative_nist_high_app(self): """Generic Test failure""" - self.helper_file_negative('fixtures/templates/quickstart/nist_application.yaml', 53) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_application.yaml', 53) def test_file_negative_nist_config_rules(self): """Generic Test failure""" - self.helper_file_negative('fixtures/templates/quickstart/nist_config_rules.yaml', 2) + self.helper_file_negative('test/fixtures/templates/quickstart/nist_config_rules.yaml', 2) def test_file_negative_generic(self): """Generic Test failure""" - self.helper_file_negative('fixtures/templates/bad/generic.yaml', 7) + self.helper_file_negative('test/fixtures/templates/bad/generic.yaml', 7) diff --git a/test/rules/resources/properties/test_vpcid.py b/test/rules/resources/properties/test_vpcid.py index 3b34da4e0a..c9f50c3c25 100644 --- a/test/rules/resources/properties/test_vpcid.py +++ b/test/rules/resources/properties/test_vpcid.py @@ -25,7 +25,7 @@ def setUp(self): super(TestPropertyVpcId, self).setUp() self.collection.register(VpcId()) self.success_templates = [ - 'fixtures/templates/good/properties_ec2_vpc.yaml' + 'test/fixtures/templates/good/properties_ec2_vpc.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/properties_vpcid.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/properties_vpcid.yaml', 1) diff --git a/test/rules/resources/rds/test_instance_sizes.py b/test/rules/resources/rds/test_instance_sizes.py index 19d51523c3..a111f7904c 100644 --- a/test/rules/resources/rds/test_instance_sizes.py +++ b/test/rules/resources/rds/test_instance_sizes.py @@ -25,7 +25,7 @@ def setUp(self): super(TestInstanceSize, self).setUp() self.collection.register(InstanceSize()) self.success_templates = [ - 'fixtures/templates/good/resources/rds/instance_sizes.yaml' + 'test/fixtures/templates/good/resources/rds/instance_sizes.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative_alias(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/rds/instance_sizes.yaml', 7, ['us-east-1', 'eu-west-3']) + self.helper_file_negative('test/fixtures/templates/bad/resources/rds/instance_sizes.yaml', 7, ['us-east-1', 'eu-west-3']) diff --git a/test/rules/resources/route53/test_recordsets.py b/test/rules/resources/route53/test_recordsets.py index ade8d57f33..6127101644 100644 --- a/test/rules/resources/route53/test_recordsets.py +++ b/test/rules/resources/route53/test_recordsets.py @@ -25,7 +25,7 @@ def setUp(self): super(TestRoute53RecordSets, self).setUp() self.collection.register(RecordSet()) self.success_templates = [ - 'fixtures/templates/good/route53.yaml' + 'test/fixtures/templates/good/route53.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative_alias(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/route53.yaml', 25) + self.helper_file_negative('test/fixtures/templates/bad/route53.yaml', 25) diff --git a/test/rules/resources/stepfunctions/test_state_machine.py b/test/rules/resources/stepfunctions/test_state_machine.py index 490c4c4dc9..b24dc0f440 100644 --- a/test/rules/resources/stepfunctions/test_state_machine.py +++ b/test/rules/resources/stepfunctions/test_state_machine.py @@ -24,7 +24,7 @@ def setUp(self): super(TestStateMachine, self).setUp() self.collection.register(StateMachine()) self.success_templates = [ - 'fixtures/templates/good/resources/stepfunctions/state_machine.yaml' + 'test/fixtures/templates/good/resources/stepfunctions/state_machine.yaml' ] def test_file_positive(self): @@ -33,4 +33,4 @@ def test_file_positive(self): def test_file_negative_alias(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/stepfunctions/state_machine.yaml', 5) + self.helper_file_negative('test/fixtures/templates/bad/resources/stepfunctions/state_machine.yaml', 5) diff --git a/test/rules/resources/test_circulary_dependency.py b/test/rules/resources/test_circulary_dependency.py index e824699240..5f1f6dfdd6 100644 --- a/test/rules/resources/test_circulary_dependency.py +++ b/test/rules/resources/test_circulary_dependency.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_circulary_dependency.yaml', 6) + self.helper_file_negative('test/fixtures/templates/bad/resources_circulary_dependency.yaml', 6) diff --git a/test/rules/resources/test_configurations.py b/test/rules/resources/test_configurations.py index a504f7f867..b5f726830c 100644 --- a/test/rules/resources/test_configurations.py +++ b/test/rules/resources/test_configurations.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/generic.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/generic.yaml', 2) diff --git a/test/rules/resources/test_dependson.py b/test/rules/resources/test_dependson.py index 66a5ab2472..2bc65fdc7e 100644 --- a/test/rules/resources/test_dependson.py +++ b/test/rules/resources/test_dependson.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources_dependson.yaml', 3) + self.helper_file_negative('test/fixtures/templates/bad/resources_dependson.yaml', 3) diff --git a/test/rules/resources/test_limitname.py b/test/rules/resources/test_limitname.py index bfe1d1d7b0..0238867631 100644 --- a/test/rules/resources/test_limitname.py +++ b/test/rules/resources/test_limitname.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_name.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_name.yaml', 1) diff --git a/test/rules/resources/test_limitnumber.py b/test/rules/resources/test_limitnumber.py index 668cb92621..eab08f89af 100644 --- a/test/rules/resources/test_limitnumber.py +++ b/test/rules/resources/test_limitnumber.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_numbers.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_numbers.yaml', 1) diff --git a/test/rules/resources/test_name.py b/test/rules/resources/test_name.py index b908f2ce86..a30b310d1e 100644 --- a/test/rules/resources/test_name.py +++ b/test/rules/resources/test_name.py @@ -25,7 +25,7 @@ def setUp(self): super(TestName, self).setUp() self.collection.register(Name()) self.success_templates = [ - 'fixtures/templates/good/resources/name.yaml' + 'test/fixtures/templates/good/resources/name.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/name.yaml', 2) + self.helper_file_negative('test/fixtures/templates/bad/resources/name.yaml', 2) diff --git a/test/rules/resources/updatepolicy/test_configuration.py b/test/rules/resources/updatepolicy/test_configuration.py index 83181c2a64..dfd4ce2bc1 100644 --- a/test/rules/resources/updatepolicy/test_configuration.py +++ b/test/rules/resources/updatepolicy/test_configuration.py @@ -25,7 +25,7 @@ def setUp(self): super(TestConfiguration, self).setUp() self.collection.register(Configuration()) self.success_templates = [ - 'fixtures/templates/good/resources/updatepolicy/config.yaml' + 'test/fixtures/templates/good/resources/updatepolicy/config.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative_alias(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/resources/updatepolicy/config.yaml', 11) + self.helper_file_negative('test/fixtures/templates/bad/resources/updatepolicy/config.yaml', 11) diff --git a/test/rules/templates/test_base_template.py b/test/rules/templates/test_base_template.py index 2216195512..4e5af37761 100644 --- a/test/rules/templates/test_base_template.py +++ b/test/rules/templates/test_base_template.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/generic.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/generic.yaml', 1) diff --git a/test/rules/templates/test_description.py b/test/rules/templates/test_description.py index b68db7311b..f73e01283b 100644 --- a/test/rules/templates/test_description.py +++ b/test/rules/templates/test_description.py @@ -25,7 +25,7 @@ def setUp(self): super(TestDescription, self).setUp() self.collection.register(Description()) self.success_templates = [ - 'fixtures/templates/good/templates/description.yaml' + 'test/fixtures/templates/good/templates/description.yaml' ] def test_file_positive(self): @@ -34,4 +34,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/templates/description.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/templates/description.yaml', 1) diff --git a/test/rules/templates/test_limitsize_description.py b/test/rules/templates/test_limitsize_description.py index a746e041a0..4863423cb4 100644 --- a/test/rules/templates/test_limitsize_description.py +++ b/test/rules/templates/test_limitsize_description.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_size.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_size.yaml', 1) diff --git a/test/rules/templates/test_limitsize_template.py b/test/rules/templates/test_limitsize_template.py index 8260199cae..475bd6c6d9 100644 --- a/test/rules/templates/test_limitsize_template.py +++ b/test/rules/templates/test_limitsize_template.py @@ -31,4 +31,4 @@ def test_file_positive(self): def test_file_negative(self): """Test failure""" - self.helper_file_negative('fixtures/templates/bad/limit_size.yaml', 1) + self.helper_file_negative('test/fixtures/templates/bad/limit_size.yaml', 1) diff --git a/test/rules/templates/test_yaml_template.py b/test/rules/templates/test_yaml_template.py index 55d7fa5d85..cb3a0314ab 100644 --- a/test/rules/templates/test_yaml_template.py +++ b/test/rules/templates/test_yaml_template.py @@ -28,7 +28,7 @@ def setUp(self): def test_file_negative(self): """Failure test""" - failure = 'fixtures/templates/bad/template.yaml' + failure = 'test/fixtures/templates/bad/template.yaml' try: Runner(self.collection, failure, True) self.assertEqual(1, 0) diff --git a/tox.ini b/tox.ini index ac0c735f8c..d8b7635622 100644 --- a/tox.ini +++ b/tox.ini @@ -1,39 +1,47 @@ [tox] -envlist = py27,py34,py35,py36,py37,pylint36,pylint27 +envlist = py{27,34,35,36,37},pylint{36,27} [testenv] -changedir = test -commands = python -m unittest discover +commands = + pip install -e . + coverage run -m unittest discover -s test +skip_install = True deps = - requests>=2.15.0 - six~=1.11 - aws-sam-translator>=1.8.0 - jsonpatch mock - pathlib2>=2.3.0 - regex>=2018.11.07 + coverage setenv = LANG=en_US.UTF-8 AWS_DEFAULT_REGION=us-east-1 + COVERAGE_FILE = {env:COVERAGE_FILE:.coverage.{envname}} + +[testenv:codecov] +deps = + coverage + codecov +skip_install = True +passenv = CI TRAVIS TRAVIS_* +setenv = + COVERAGE_FILE=.coverage +commands = + coverage erase + coverage combine + coverage report + codecov [testenv:pylint36] -changedir = basepython = python3.6 deps = + pylint_quotes pylint - requests>=2.15.0 - pylint-quotes - jsonpatch - regex>=2018.11.07 -commands=pylint --load-plugins pylint_quotes src/cfnlint +commands = + pip install -e . + pylint --load-plugins pylint_quotes src/cfnlint [testenv:pylint27] -changedir = basepython = python2.7 deps = + pylint_quotes pylint - requests>=2.15.0 - pylint-quotes - jsonpatch - regex>=2018.11.07 -commands=pylint --load-plugins pylint_quotes src/cfnlint +commands = + pip install -e . + pylint --load-plugins pylint_quotes src/cfnlint