Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_passed(self, m_boto):
cwd = os.getcwd()
try:
config_path = Path(
build_test_case("/tmp/lint_test_output/", test_cases[0])
).resolve()
project_root = config_path.parent.parent
config = Config.create(
project_config_path=config_path, project_root=project_root
)
templates = config.get_templates(project_root)
lint = Lint(config=config, templates=templates)
self.assertEqual(lint.passed, True)
lint_key = list(lint.lints[0])[0]
result_key = list(lint.lints[0][lint_key]["results"])[0]
test = lint.lints[0][lint_key]["results"][result_key]
rule = mock.Mock(return_val="[E0001] some error")
rule.rule.id = "E0001"
rule.linenumber = 123
rule.rule.shortdesc = "short error"
rule.message = "some error"
test.append(rule)
lint.strict = True
def test_standalone_template(self):
base_path = "./" if os.getcwd().endswith("/tests") else "./tests/"
base_path = Path(base_path + "data/legacy_test/templates/").resolve()
Config.create(template_file=base_path / "test.template.yaml")