MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_set_bool_completion

Function test_set_bool_completion

tests/test_completion.py:346–355  ·  view source on GitHub ↗

Confirm that completing a boolean Settable presents true and false strings

(cmd2_app)

Source from the content-addressed store, hash-verified

344
345
346def test_set_bool_completion(cmd2_app) -> None:
347 """Confirm that completing a boolean Settable presents true and false strings"""
348 text = ""
349 line = "set debug"
350 endidx = len(line)
351 begidx = endidx - len(text)
352
353 expected = ["false", "true"]
354 completions = cmd2_app.complete(text, line, begidx, endidx)
355 assert completions.to_strings() == Completions.from_values(expected).to_strings()
356
357
358def test_shell_command_completion_shortcut(cmd2_app) -> None:

Callers

nothing calls this directly

Calls 3

to_stringsMethod · 0.80
from_valuesMethod · 0.80
completeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…