File size: 432 Bytes
1600cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | """Tests for src.notes."""
from src.notes import read_note, write_note
def test_write_then_read_round_trip(tmp_path) -> None:
path = tmp_path / "note.txt"
body = "first line\nsecond line\n"
assert write_note(path, body) == len(body)
assert read_note(path) == body
def test_read_note_of_an_empty_file(tmp_path) -> None:
path = tmp_path / "empty.txt"
write_note(path, "")
assert read_note(path) == ""
|