|
1 | 1 | """Tests for the `replace-docs` subcommand.""" |
2 | 2 |
|
3 | | -from argparse import ArgumentParser |
4 | | -from argparse import Namespace |
| 3 | +from argparse import ArgumentParser, Namespace |
5 | 4 | from subprocess import CalledProcessError # noqa: S404. We invoke cli tools |
6 | 5 |
|
7 | 6 | import pytest |
8 | 7 | import pytest_mock |
9 | 8 |
|
10 | 9 | from pre_commit_terraform._structs import ReturnCode |
11 | | -from pre_commit_terraform.terraform_docs_replace import invoke_cli_app |
12 | | -from pre_commit_terraform.terraform_docs_replace import populate_argument_parser |
| 10 | +from pre_commit_terraform.terraform_docs_replace import ( |
| 11 | + invoke_cli_app, |
| 12 | + populate_argument_parser, |
| 13 | +) |
13 | 14 | from pre_commit_terraform.terraform_docs_replace import ( |
14 | 15 | subprocess as replace_docs_subprocess_mod, |
15 | 16 | ) |
@@ -53,7 +54,8 @@ def test_check_is_deprecated() -> None: |
53 | 54 | ), |
54 | 55 | [ |
55 | 56 | 'terraform-docs --sort-by-required md ./ > .//SENTINEL.md', |
56 | | - 'terraform-docs --sort-by-required md ./thing > ./thing/SENTINEL.md', |
| 57 | + 'terraform-docs --sort-by-required md ./thing ' |
| 58 | + '> ./thing/SENTINEL.md', |
57 | 59 | ], |
58 | 60 | id='two-sorted-files', |
59 | 61 | ), |
@@ -84,7 +86,9 @@ def test_control_flow_positive( |
84 | 86 |
|
85 | 87 | assert invoke_cli_app(parsed_cli_args) == ReturnCode.OK |
86 | 88 |
|
87 | | - executed_commands = [cmd for ((cmd,), _shell) in check_call_mock.call_args_list] |
| 89 | + executed_commands = [ |
| 90 | + cmd for ((cmd,), _shell) in check_call_mock.call_args_list |
| 91 | + ] |
88 | 92 |
|
89 | 93 | assert len(expected_cmds) == check_call_mock.call_count |
90 | 94 | assert expected_cmds == executed_commands |
|
0 commit comments