File tree Expand file tree Collapse file tree
message_ix_models/tests/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from subprocess import CalledProcessError , check_call
2+
13import pytest
24
35from message_ix_models .tools .res_marg import main
46
57
6- @pytest .mark .xfail (reason = "Incomplete test" )
78def test_cli () -> None :
8- # TODO Complete
9- assert False
9+ """Run :func:`.res_marg.main` via its command-line interface."""
10+ command = [
11+ "python" ,
12+ "-m" ,
13+ "message_ix_models.tools.res_marg" ,
14+ "--version=123" ,
15+ "model_name" ,
16+ "scenario_name" ,
17+ ]
18+
19+ # Fails: the model name, scenario name, and version do not exit
20+ with pytest .raises (CalledProcessError ):
21+ check_call (command )
22+
1023
24+ @pytest .mark .xfail (reason = "Function does not run on the snapshot" )
25+ def test_main (loaded_snapshot ) -> None :
26+ """Run :func:`.res_marg.main` on the snapshot scenarios."""
27+ scen = loaded_snapshot
1128
12- @pytest .mark .xfail (reason = "Incomplete test" )
13- def test_main () -> None :
14- # TODO Complete
15- main ()
29+ # Function runs
30+ main (scen , None )
You can’t perform that action at this time.
0 commit comments