MCPcopy
hub / github.com/pallets/click / test_source_uses_lf_line_endings

Function test_source_uses_lf_line_endings

tests/test_shell_completion.py:376–387  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

374
375
376def test_source_uses_lf_line_endings(monkeypatch):
377 stdout = io.BytesIO()
378 stream = io.TextIOWrapper(stdout, encoding="utf-8", newline="\r\n")
379 monkeypatch.setattr("click.utils._default_text_stdout", lambda: stream)
380
381 cli = Group("cli", commands=[Command("a"), Command("b")])
382 assert shell_complete(cli, {}, "cli", "_CLI_COMPLETE", "zsh_source") == 0
383
384 stream.flush()
385 output = stdout.getvalue()
386 assert b"\r\n" not in output
387 assert b"\n" in output
388
389
390@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

GroupClass · 0.90
CommandClass · 0.90
shell_completeFunction · 0.90
getvalueMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…