Commit 83ec79f
Improve e2e tests: use tmp_path and pytest.raises
The two --rpm-dir tests patched os.path.isdir and glob.glob directly,
coupling the tests to implementation internals (the fact that the code uses
os.path.isdir rather than pathlib, for example).
Replace the mocked filesystem calls with real filesystem state:
- test_cli_rpm_dir_not_found: pass tmp_path / 'nonexistent', which is a
genuinely non-existent directory with no patching needed.
- test_cli_rpm_dir_no_rpms: pass the empty tmp_path directly.
Replace the try/except SystemExit pattern with pytest.raises(SystemExit) in
all three tests, which is the idiomatic pytest style.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent f2079c2 commit 83ec79f
1 file changed
Lines changed: 18 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
23 | 22 | | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
30 | 27 | | |
31 | | - | |
| 28 | + | |
32 | 29 | | |
33 | | - | |
| 30 | + | |
34 | 31 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 32 | + | |
| 33 | + | |
41 | 34 | | |
42 | | - | |
43 | | - | |
44 | 35 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
48 | 39 | | |
49 | 40 | | |
50 | 41 | | |
51 | 42 | | |
52 | 43 | | |
53 | 44 | | |
54 | | - | |
55 | | - | |
| 45 | + | |
56 | 46 | | |
57 | | - | |
58 | | - | |
59 | 47 | | |
60 | | - | |
| 48 | + | |
0 commit comments