Skip to content

Commit 99a1a33

Browse files
committed
. d tidy code and update markdown snippets
1 parent 0ed6aa3 commit 99a1a33

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

approvaltests/reporters/report_by_opening_files.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class ReportByOpeningFiles(Reporter):
13-
1413
@staticmethod
1514
def display_file(file_path: str) -> None:
1615
call = ReportByOpeningFiles.get_opening_command(file_path, platform.system())

internal_documentation/micro_features/report_by_opening_files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Allows users to visually inspect the received and approved files by automaticall
2020

2121

2222
## Integration
23-
- Implements the `ApprovalFailureReporter` interface.
23+
- Implements the `ApprovalFailureReporter` interface.

tests/reporters/test_report_by_opening_files.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,31 @@ def test_is_non_empty_file_with_empty_file() -> None:
1717

1818
shutil.rmtree(temp_dir, ignore_errors=True)
1919

20+
2021
def test_is_non_empty_file() -> None:
2122
assert ReportByOpeningFiles.is_non_empty_file(__file__)
2223

24+
2325
def test_is_non_missing_file() -> None:
2426
assert not ReportByOpeningFiles.is_non_empty_file("non_existent.txt")
2527

28+
2629
def test_current_os_is_known() -> None:
2730
ReportByOpeningFiles.get_opening_command("text.txt", platform.system())
2831

32+
2933
def test_unknown_os() -> None:
3034
with pytest.raises(KeyError):
3135
ReportByOpeningFiles.get_opening_command("text.txt", "unknown")
3236

33-
def test_get_opening_command() -> None:
34-
assert ["start", "text.txt"] == ReportByOpeningFiles.get_opening_command("text.txt", "Windows")
35-
assert ["open", "text.txt"] == ReportByOpeningFiles.get_opening_command("text.txt", "Darwin")
36-
assert ["xdg-open", "text.txt"] == ReportByOpeningFiles.get_opening_command("text.txt", "Linux")
3737

38-
38+
def test_get_opening_command() -> None:
39+
assert ["start", "text.txt"] == ReportByOpeningFiles.get_opening_command(
40+
"text.txt", "Windows"
41+
)
42+
assert ["open", "text.txt"] == ReportByOpeningFiles.get_opening_command(
43+
"text.txt", "Darwin"
44+
)
45+
assert ["xdg-open", "text.txt"] == ReportByOpeningFiles.get_opening_command(
46+
"text.txt", "Linux"
47+
)

0 commit comments

Comments
 (0)