| """The eval CLI defaults to `processbench` when no subcommand is named.""" |
| from mathcompose.eval.run import _default_subcommand |
|
|
|
|
| def test_inserts_processbench_when_missing(): |
| assert _default_subcommand(["--adapter", "X", "--code-exec"]) == \ |
| ["processbench", "--adapter", "X", "--code-exec"] |
|
|
|
|
| def test_keeps_base_id_before_subcommand(): |
| assert _default_subcommand(["--base-id", "Y", "--adapter", "X"]) == \ |
| ["--base-id", "Y", "processbench", "--adapter", "X"] |
| assert _default_subcommand(["--base-id=Y", "--adapter", "X"]) == \ |
| ["--base-id=Y", "processbench", "--adapter", "X"] |
|
|
|
|
| def test_leaves_explicit_subcommand_alone(): |
| for argv in (["processbench", "--adapter", "X"], ["report"], ["-h"], []): |
| assert _default_subcommand(argv) == argv |
|
|