|
9 | 9 |
|
10 | 10 | ROBOTO_BEFORE_PATH = os.path.join("tests", "testfiles", "Roboto-Regular.subset1.ttf")
|
11 | 11 | 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 | +) |
18 | 30 |
|
19 | 31 | ROBOTO_BEFORE_URL = "https://github.com/source-foundry/fdiff/raw/master/tests/testfiles/Roboto-Regular.subset1.ttf"
|
20 | 32 | 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):
|
80 | 92 | # Mutually exclusive argument tests
|
81 | 93 | #
|
82 | 94 |
|
| 95 | + |
83 | 96 | 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 | + ] |
85 | 105 |
|
86 | 106 | with pytest.raises(SystemExit) as exit_info:
|
87 | 107 | run(args)
|
88 | 108 |
|
89 | 109 | 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 |
92 | 114 |
|
93 | 115 |
|
94 | 116 | #
|
95 | 117 | # Unified diff integration tests
|
96 | 118 | #
|
97 | 119 |
|
| 120 | + |
98 | 121 | def test_main_run_unified_default_local_files_no_diff(capsys):
|
99 | 122 | """Test default behavior when there is no difference in font files under evaluation"""
|
100 | 123 | args = [ROBOTO_BEFORE_PATH, ROBOTO_BEFORE_PATH]
|
|
0 commit comments