|
|
|
@ -124,3 +124,44 @@ def test_endswith() -> None:
|
|
|
|
|
|
|
|
|
|
assert path.endswith('.txt')
|
|
|
|
|
assert not path.endswith('.py')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_eq_other_path() -> None:
|
|
|
|
|
"""Test if Paths can be compared to other Paths"""
|
|
|
|
|
assert Path('/test.txt') == Path('/test.txt')
|
|
|
|
|
assert Path('/test.txt') != Path('/test.md')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_eq_str() -> None:
|
|
|
|
|
"""Test if Paths can be compared to strings"""
|
|
|
|
|
|
|
|
|
|
assert Path('/test.txt') == '/test.txt'
|
|
|
|
|
assert Path('/test.txt') != '/test.md'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_lt() -> None:
|
|
|
|
|
"""Test if Paths can be sorted with other Paths (< direction)"""
|
|
|
|
|
|
|
|
|
|
assert Path('/test.txt') < Path('/very.txt')
|
|
|
|
|
assert not Path('/test.txt') < Path('/much.txt') # pylint: disable=unneeded-not
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_lt_str() -> None:
|
|
|
|
|
"""Test if Paths can be sorted with strings (< direction)"""
|
|
|
|
|
|
|
|
|
|
assert Path('/very.txt') > '/test.txt'
|
|
|
|
|
assert not Path('/much.txt') > '/test.txt' # pylint: disable=unneeded-not
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_gt() -> None:
|
|
|
|
|
"""Test if Paths can be sorted with other Paths (> direction)"""
|
|
|
|
|
|
|
|
|
|
assert Path('/very.txt') > Path('/test.txt')
|
|
|
|
|
assert not Path('/much.txt') > Path('/test.txt') # pylint: disable=unneeded-not
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_g_str() -> None:
|
|
|
|
|
"""Test if Paths can be sorted with strings (> direction)"""
|
|
|
|
|
|
|
|
|
|
assert Path('/very.txt') > '/test.txt'
|
|
|
|
|
assert not Path('/much.txt') > '/test.txt' # pylint: disable=unneeded-not
|
|
|
|
|