Commit 9fcb11a 1 parent bf50183 commit 9fcb11a Copy full SHA for 9fcb11a
File tree 1 file changed +16
-35
lines changed
1 file changed +16
-35
lines changed Original file line number Diff line number Diff line change 9
9
from .conftest import run_cli
10
10
11
11
12
- def test_x2pdf_with_format (capsys , tmp_path : Path ) -> None :
12
+ def test_x2pdf (capsys , tmp_path : Path ) -> None :
13
13
# Arrange
14
14
output = tmp_path / "out.pdf"
15
15
assert not output .exists ()
16
-
17
- formats_to_test = [
18
- "Letter" ,
19
- "A4-portrait" ,
20
- "A4-landscape" ,
21
- "210x297" ,
22
- "invalid-format"
23
- ]
24
-
25
- for format_option in formats_to_test :
26
- # Act
27
- exit_code = run_cli (
28
- [
29
- "x2pdf" ,
30
- "sample-files/003-pdflatex-image/page-0-Im1.jpg" ,
31
- "--output" ,
32
- str (output ),
33
- "--format" ,
34
- format_option ,
35
- ]
36
- )
37
16
38
- # Assert
39
- captured = capsys .readouterr ()
40
-
41
- # For valid formats, we expect a successful exit code and the output file to exist
42
- if format_option != "invalid-format" :
43
- assert exit_code == 0 , captured
44
- assert captured .out == ""
45
- assert output .exists ()
46
- else :
47
- # For an invalid format, we expect a non-zero exit code (indicating failure)
48
- assert exit_code != 0
49
- assert "Invalid format" in captured .err # Check for expected error message
50
- output .unlink (missing_ok = True ) # Clean up for the next test iteration
17
+ # Act
18
+ exit_code = run_cli (
19
+ [
20
+ "x2pdf" ,
21
+ "sample-files/003-pdflatex-image/page-0-Im1.jpg" ,
22
+ "--output" ,
23
+ str (output ),
24
+ ]
25
+ )
26
+
27
+ # Assert
28
+ captured = capsys .readouterr ()
29
+ assert exit_code == 0 , captured
30
+ assert captured .out == ""
31
+ assert output .exists ()
You can’t perform that action at this time.
0 commit comments