File size: 789 Bytes
ca5eeeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""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