Skip to content
Myr

✅ Add Fish shell completion tests for colon options (#1475)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Mohamed Elmujtaba Elwasila · committed by GitHub · parent f81e714 · Browse files · 1 file+55 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
  • Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com>

Diff stats

1 file+55 added−1 removed

  • tests:+55 added−1 removed

1 file+55 added−1 removed

modified:tests/test_completion/test_completion_option_colon.py+55 added-1 removed
232 unmodified lines
233 assert "latest alpine image" not in result.stdout234 assert "nvidia/cuda:10.0-devel-ubuntu18.04" not in result.stdout235236237# TODO: tests for complete_fish237def test_completion_colon_fish_all():238 result = subprocess.run(239 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],240 capture_output=True,241 encoding="utf-8",242 env={243 **os.environ,244 "_COLON_EXAMPLE.PY_COMPLETE": "complete_fish",245 "_TYPER_COMPLETE_ARGS": "colon_example.py --name ",246 "_TYPER_COMPLETE_FISH_ACTION": "get-args",247 },248 )249 assert "alpine:hello" in result.stdout250 assert "fake image: for testing" in result.stdout251 assert "alpine:latest" in result.stdout252 assert "latest alpine image" in result.stdout253 assert "nvidia/cuda:10.0-devel-ubuntu18.04" in result.stdout254255256def test_completion_colon_fish_partial():257 result = subprocess.run(258 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],259 capture_output=True,260 encoding="utf-8",261 env={262 **os.environ,263 "_COLON_EXAMPLE.PY_COMPLETE": "complete_fish",264 "_TYPER_COMPLETE_ARGS": "colon_example.py --name alpine",265 "_TYPER_COMPLETE_FISH_ACTION": "get-args",266 },267 )268 assert "alpine:hello" in result.stdout269 assert "fake image: for testing" in result.stdout270 assert "alpine:latest" in result.stdout271 assert "latest alpine image" in result.stdout272 assert "nvidia/cuda:10.0-devel-ubuntu18.04" not in result.stdout273274275def test_completion_colon_fish_single():276 result = subprocess.run(277 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],278 capture_output=True,279 encoding="utf-8",280 env={281 **os.environ,282 "_COLON_EXAMPLE.PY_COMPLETE": "complete_fish",283 "_TYPER_COMPLETE_ARGS": "colon_example.py --name alpine:hell",284 "_TYPER_COMPLETE_FISH_ACTION": "get-args",285 },286 )287 assert "alpine:hello" in result.stdout288 assert "fake image: for testing" in result.stdout289 assert "alpine:latest" not in result.stdout290 assert "latest alpine image" not in result.stdout291 assert "nvidia/cuda:10.0-devel-ubuntu18.04" not in result.stdout