Python: basic, package install, error handler for begining
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
25
tests/lib/test_dir_not_found_error.py
Normal file
25
tests/lib/test_dir_not_found_error.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from repo_cloner.lib.dir_not_found_error import DirNotFoundError
|
||||
from pathlib import PosixPath
|
||||
|
||||
|
||||
def test_type():
|
||||
x = DirNotFoundError()
|
||||
assert isinstance(x, DirNotFoundError)
|
||||
|
||||
|
||||
def test_return():
|
||||
x = DirNotFoundError("/tmp")
|
||||
s = x.__str__()
|
||||
assert s == "Directory does not exist / is not a dir: /tmp"
|
||||
|
||||
|
||||
def test_return_empty():
|
||||
x = DirNotFoundError()
|
||||
s = x.__str__()
|
||||
assert s == "DirNotFoundError()"
|
||||
|
||||
|
||||
def test_posix_path():
|
||||
d = PosixPath("/nonexistent")
|
||||
x = DirNotFoundError(d)
|
||||
assert x.__str__() == "Directory does not exist / is not a dir: /nonexistent"
|
||||
Reference in New Issue
Block a user