Skip to content

Commit

Permalink
added test for output-path
Browse files Browse the repository at this point in the history
  • Loading branch information
scap3yvt authored Jul 10, 2024
1 parent 40b0cdb commit 7deb9b4
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion testing/entrypoints/test_optimize_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,27 @@
TmpFile("model.pth.tar", content="123321"),
TmpFile("config.yaml", content="foo: bar"),
TmpNoEx("path_na"),
TmpDire("output/"),
]
test_cases = [
CliCase(
should_succeed=True,
new_way_lines=[
# full command with output
"--model model.pth.tar --config config.yaml --output-path output/",
# tests short arg aliases
"-m model.pth.tar -c config.yaml -o output/",
],
old_way_lines=[
"--model model.pth.tar --config config.yaml --output_path output/",
"-m model.pth.tar -c config.yaml -o output/",
],
expected_args={
"model_path": "model.pth.tar",
"config_path": "config.yaml",
"output_path": "output/",
},
),
CliCase(
should_succeed=True,
new_way_lines=[
Expand All @@ -31,7 +50,11 @@
"--model model.pth.tar --config config.yaml",
"-m model.pth.tar -c config.yaml",
],
expected_args={"model_path": "model.pth.tar", "config_path": "config.yaml"},
expected_args={
"model_path": "model.pth.tar",
"config_path": "config.yaml",
"output_path": None,
},
),
CliCase(
should_succeed=True,
Expand Down

0 comments on commit 7deb9b4

Please sign in to comment.