added stuff
This commit is contained in:
1 parent
c1c13022ee
commit
9624918f12
4 files changed
+54
No files matched your search
Whitespace-only changes.
@@ -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
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
function foo(){
|
||||||
|
let multiLineMessage = `
|
||||||
|
un
|
||||||
|
deux
|
||||||
|
trois`;
|
||||||
|
console.log(multiLineMessage)
|
||||||
|
}
|
||||||
|
foo();
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
class User:
|
||||||
|
|
||||||
|
def __init__(self, email, company):
|
||||||
|
self.email = email
|
||||||
|
self.company = company
|
||||||
|
|
||||||
|
def get_user_id(self) -> str:
|
||||||
|
return self.email + "/" + self.company
|
||||||
|
|
||||||
|
|
||||||
|
class MockUser(User):
|
||||||
|
|
||||||
|
def get_user_id(self) -> str:
|
||||||
|
return self.email
|
||||||
|
|
||||||
|
def get_real_name(self):
|
||||||
|
return "andre"
|
||||||
|
|
||||||
|
|
||||||
|
def pretty_print_user(user: User):
|
||||||
|
email, company = user.get_user_id().split("/")
|
||||||
|
|
||||||
Reference in new issue
Block a user