mirror of
https://github.com/aclist/dztui.git
synced 2026-11-10 03:50:38 +01:00
26 lines
583 B
Python
26 lines
583 B
Python
from typing import TYPE_CHECKING
|
|
|
|
from dzgui.init.migrate import clean_legacy_versions_file
|
|
|
|
if TYPE_CHECKING:
|
|
from pathlib import Path
|
|
|
|
|
|
def test_null_signature_stripping(tmp_path: "Path") -> None:
|
|
tmp = tmp_path.joinpath("dzg.versions")
|
|
lines = [
|
|
"1111,2222",
|
|
"3333,4444",
|
|
"5555,null",
|
|
"foo",
|
|
",4555",
|
|
"1111",
|
|
" ",
|
|
",,,",
|
|
"-1",
|
|
]
|
|
expect = ["1111,2222", "3333,4444"]
|
|
tmp.write_text("\n".join(lines))
|
|
clean_legacy_versions_file(tmp)
|
|
assert expect == tmp.read_text().splitlines()
|