added stuff
This commit is contained in:
1 parent
c1c13022ee
commit
9624918f12
4 files changed
+54
No files matched your search
@@ -0,0 +1,22 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def count_number_of_line(filename: str) -> int:
|
||||
with open(filename, "rt") as file_:
|
||||
return file_.read().count("\n")
|
||||
|
||||
|
||||
def test_naive() -> None:
|
||||
# setup
|
||||
temp_file = Path("/tmp/test_toto")
|
||||
temp_file.write_text("allo\nmon\ncoco\n")
|
||||
assert count_number_of_line(temp_file) == 3
|
||||
temp_file.unlink()
|
||||
|
||||
|
||||
def test_with_basic_fixture(tmp_path: Path) -> None:
|
||||
temp_file = tmp_path / "test_file"
|
||||
temp_file.write_text("allo\nmon\ncoco\n")
|
||||
assert count_number_of_line(temp_file) == 3
|
||||
|
||||
|
||||
Reference in new issue
Block a user