66try :
77 from typer .testing import CliRunner
88
9+ runner = CliRunner ()
910 from fundamend .cli import app
1011except ImportError :
1112 _SKIP_TESTS = True
@@ -23,8 +24,8 @@ def test_cli_single_file_mig(tmp_path: Path) -> None:
2324 original_mig_file = Path (__file__ ).parent / "example_files" / "UTILTS_MIG_1.1c_Lesefassung_2023_12_12.xml"
2425 tmp_mig_path = tmp_path / "my_mig.xml"
2526 _copy_xml_file (original_mig_file , tmp_mig_path )
26- runner = CliRunner ( )
27- runner . invoke ( app , [ str ( tmp_mig_path )])
27+ result = runner . invoke ( app , [ "--xml-path" , str ( tmp_mig_path . absolute ())] )
28+ assert result . exit_code == 0
2829 assert (tmp_path / "my_mig.json" ).exists ()
2930
3031
@@ -34,8 +35,8 @@ def test_cli_single_file_ahb(tmp_path: Path) -> None:
3435 original_ahb_file = Path (__file__ ).parent / "example_files" / "UTILTS_AHB_1.1d_Konsultationsfassung_2024_04_02.xml"
3536 tmp_ahb_path = tmp_path / "my_ahb.xml"
3637 _copy_xml_file (original_ahb_file , tmp_ahb_path )
37- runner = CliRunner ( )
38- runner . invoke ( app , [ str ( tmp_ahb_path )])
38+ result = runner . invoke ( app , [ "--xml-path" , str ( tmp_ahb_path )] )
39+ assert result . exit_code == 0
3940 assert (tmp_path / "my_ahb.json" ).exists ()
4041
4142
@@ -48,7 +49,7 @@ def test_cli_directory(tmp_path: Path) -> None:
4849 tmp_ahb_path = tmp_path / "my_ahb.xml"
4950 _copy_xml_file (original_ahb_file , tmp_ahb_path )
5051 _copy_xml_file (original_mig_file , tmp_mig_path )
51- runner = CliRunner ( )
52- runner . invoke ( app , [ str ( tmp_path )])
52+ result = runner . invoke ( app , [ "--xml-path" , str ( tmp_path )] )
53+ assert result . exit_code == 0
5354 assert (tmp_path / "my_mig.json" ).exists ()
5455 assert (tmp_path / "my_ahb.json" ).exists ()
0 commit comments