Skip to content

Commit

Permalink
Minor cleanup to acceptance test naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sirosen committed Jan 20, 2023
1 parent e8961a4 commit 062430a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/acceptance/test_example_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _build_hook_cases(category):
example_dir = EXAMPLE_HOOK_FILES / category / hookid
if example_dir.exists():
for example in example_dir.iterdir():
res[str(example.relative_to(EXAMPLE_HOOK_FILES))] = hookid
res[str(example.relative_to(EXAMPLE_HOOK_FILES / category))] = hookid
return res


Expand Down Expand Up @@ -64,15 +64,19 @@ def test_hook_positive_examples(case_name, run_line):
_check_case_skip(case_name)

hook_id = POSITIVE_HOOK_CASES[case_name]
ret = run_line(HOOK_CONFIG[hook_id] + [str(EXAMPLE_HOOK_FILES / case_name)])
ret = run_line(
HOOK_CONFIG[hook_id] + [str(EXAMPLE_HOOK_FILES / "positive" / case_name)]
)
assert ret.exit_code == 0


@pytest.mark.parametrize("case_name", NEGATIVE_HOOK_CASES.keys())
def test_hook_negative_examples(case_name, run_line):
_check_case_skip(case_name)
hook_id = NEGATIVE_HOOK_CASES[case_name]
ret = run_line(HOOK_CONFIG[hook_id] + [str(EXAMPLE_HOOK_FILES / case_name)])
ret = run_line(
HOOK_CONFIG[hook_id] + [str(EXAMPLE_HOOK_FILES / "negative" / case_name)]
)
assert ret.exit_code == 1


Expand Down

0 comments on commit 062430a

Please sign in to comment.