MCPcopy
hub / github.com/Textualize/rich / test_open_text_mode

Function test_open_text_mode

tests/test_progress.py:616–626  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

614
615
616def test_open_text_mode() -> None:
617 fd, filename = tempfile.mkstemp()
618 with os.fdopen(fd, "wb") as f:
619 f.write(b"Hello, World!")
620 try:
621 with rich.progress.open(filename, "r") as f:
622 assert f.read() == "Hello, World!"
623 assert f.name == filename
624 assert f.closed
625 finally:
626 os.remove(filename)
627
628
629def test_wrap_file() -> None:

Callers

nothing calls this directly

Calls 3

openMethod · 0.80
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected