Skip to content

Commit 275d004

Browse files
committed
Add test case for command suggestion
1 parent 9455d8a commit 275d004

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/program.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,22 @@ def explicit_namespace_works_correctly(self):
376376
ns = Collection.from_module(load("integration"))
377377
expect("print-foo", out="foo\n", program=Program(namespace=ns))
378378

379+
def correctly_suggest_most_simillart_command(self):
380+
ns = Collection.from_module(load("integration"))
381+
expected = """
382+
No idea what '{0}' is!
383+
'{0}' is not an invoke command. See 'invoke --list'.
384+
385+
The most similar command(s):
386+
print-foo
387+
388+
""".lstrip()
389+
expect(
390+
"print-fo",
391+
err=expected.format("print-fo"),
392+
program=Program(namespace=ns),
393+
)
394+
379395
def allows_explicit_task_module_specification(self):
380396
expect("-c integration print-foo", out="foo\n")
381397

0 commit comments

Comments
 (0)