Skip to content

Commit ab4c414

Browse files
committed
fix stderr unit test for message that changed with transition to new approach for exclusive args
1 parent 060c775 commit ab4c414

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

tests/test_main.py

+32-9
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,24 @@
99

1010
ROBOTO_BEFORE_PATH = os.path.join("tests", "testfiles", "Roboto-Regular.subset1.ttf")
1111
ROBOTO_AFTER_PATH = os.path.join("tests", "testfiles", "Roboto-Regular.subset2.ttf")
12-
ROBOTO_UDIFF_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_udiff_expected.txt")
13-
ROBOTO_UDIFF_COLOR_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_udiff_color_expected.txt")
14-
ROBOTO_UDIFF_1CONTEXT_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_udiff_1context_expected.txt")
15-
ROBOTO_UDIFF_HEADONLY_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_udiff_headonly_expected.txt")
16-
ROBOTO_UDIFF_HEADPOSTONLY_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_udiff_headpostonly_expected.txt")
17-
ROBOTO_UDIFF_EXCLUDE_HEADPOST_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_udiff_ex_headpost_expected.txt")
12+
ROBOTO_UDIFF_EXPECTED_PATH = os.path.join(
13+
"tests", "testfiles", "roboto_udiff_expected.txt"
14+
)
15+
ROBOTO_UDIFF_COLOR_EXPECTED_PATH = os.path.join(
16+
"tests", "testfiles", "roboto_udiff_color_expected.txt"
17+
)
18+
ROBOTO_UDIFF_1CONTEXT_EXPECTED_PATH = os.path.join(
19+
"tests", "testfiles", "roboto_udiff_1context_expected.txt"
20+
)
21+
ROBOTO_UDIFF_HEADONLY_EXPECTED_PATH = os.path.join(
22+
"tests", "testfiles", "roboto_udiff_headonly_expected.txt"
23+
)
24+
ROBOTO_UDIFF_HEADPOSTONLY_EXPECTED_PATH = os.path.join(
25+
"tests", "testfiles", "roboto_udiff_headpostonly_expected.txt"
26+
)
27+
ROBOTO_UDIFF_EXCLUDE_HEADPOST_EXPECTED_PATH = os.path.join(
28+
"tests", "testfiles", "roboto_udiff_ex_headpost_expected.txt"
29+
)
1830

1931
ROBOTO_BEFORE_URL = "https://github.com/source-foundry/fdiff/raw/master/tests/testfiles/Roboto-Regular.subset1.ttf"
2032
ROBOTO_AFTER_URL = "https://github.com/source-foundry/fdiff/raw/master/tests/testfiles/Roboto-Regular.subset2.ttf"
@@ -80,21 +92,32 @@ def test_main_filepath_validations_false_secondfont(capsys):
8092
# Mutually exclusive argument tests
8193
#
8294

95+
8396
def test_main_include_exclude_defined_simultaneously(capsys):
84-
args = ["--include", "head", "--exclude", "head", ROBOTO_BEFORE_PATH, ROBOTO_AFTER_PATH]
97+
args = [
98+
"--include",
99+
"head",
100+
"--exclude",
101+
"head",
102+
ROBOTO_BEFORE_PATH,
103+
ROBOTO_AFTER_PATH,
104+
]
85105

86106
with pytest.raises(SystemExit) as exit_info:
87107
run(args)
88108

89109
captured = capsys.readouterr()
90-
assert captured.err.startswith("[*] Error: --include and --exclude are mutually exclusive options")
91-
assert exit_info.value.code == 1
110+
assert captured.err.endswith(
111+
"error: argument --exclude: not allowed with argument --include\n"
112+
)
113+
assert exit_info.value.code == 2
92114

93115

94116
#
95117
# Unified diff integration tests
96118
#
97119

120+
98121
def test_main_run_unified_default_local_files_no_diff(capsys):
99122
"""Test default behavior when there is no difference in font files under evaluation"""
100123
args = [ROBOTO_BEFORE_PATH, ROBOTO_BEFORE_PATH]

0 commit comments

Comments
 (0)