Skip to content

Commit 9cad189

Browse files
committed
Improve wrapper test coverage
1 parent 96b4573 commit 9cad189

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

test/test_wrapper.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import xcengine
66

77

8-
@pytest.mark.parametrize("cli_args", [["--verbose"], ["--batch"]])
8+
@pytest.mark.parametrize(
9+
"cli_args", [["--verbose"], ["--batch"], ["--server"]]
10+
)
911
def test_wrapper(tmp_path, monkeypatch, cli_args):
1012

1113
with patch("sys.argv", ["wrapper.py"] + cli_args):
@@ -16,13 +18,20 @@ def test_wrapper(tmp_path, monkeypatch, cli_args):
1618
os.environ["XC_USER_CODE_PATH"] = str(user_code_path)
1719
from xcengine import wrapper
1820

19-
with patch("util.save_datasets", save_datasets_mock := Mock()):
21+
with (
22+
patch("util.save_datasets", save_datasets_mock := Mock()),
23+
patch("util.start_server", start_server_mock := Mock()),
24+
):
2025
xcengine.wrapper.main()
2126

2227
assert save_datasets_mock.call_count == (
2328
1 if "--batch" in cli_args else 0
2429
)
2530

31+
assert start_server_mock.call_count == (
32+
1 if "--server" in cli_args else 0
33+
)
34+
2635

2736
@patch("sys.argv", ["wrapper.py", "--bar", "17"])
2837
@patch.dict(os.environ, {"xce_baz": "42"})

0 commit comments

Comments
 (0)