Skip to content

Commit 628f1c9

Browse files
authored
feat: Make api option required for exec (#197)
When testing `transcriptic exec`, noticed that we are implicitly requiring `api` option to be specified. Not specifying `api` currently results in a non-helpful error message, so this makes it explicitly required.
1 parent d31cc1c commit 628f1c9

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

test/commands/exec_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ def ap_file(tmpdir_factory):
2626
return path
2727

2828

29+
def test_unspecified_api(cli_test_runner, ap_file):
30+
result = cli_test_runner.invoke(cli, ["exec", str(ap_file)])
31+
assert result.exit_code != 0
32+
assert "Missing option '--api'" in result.stderr
33+
34+
2935
def test_good_autoprotocol(cli_test_runner, monkeypatch, ap_file):
3036
def mockpost(*args, **kwargs):
3137
return MockResponse(0, bool_success_res(), json.dumps(bool_success_res()))

transcriptic/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,10 @@ def format_cmd(manifest):
633633
@cli.command("exec")
634634
@click.argument("autoprotocol", type=click.File("r"), default=sys.stdin)
635635
@click.option(
636-
"--api", "-a", help="The api endpoint of your scle test workcell instance."
636+
"--api",
637+
"-a",
638+
help="The api endpoint of your scle test workcell instance.",
639+
required=True,
637640
)
638641
@click.option(
639642
"--workcell-id",

0 commit comments

Comments
 (0)