mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-11-25 05:53:00 +00:00
32 lines
645 B
Python
32 lines
645 B
Python
|
from pathlib import Path
|
||
|
|
||
|
from kiwi_scp.instance import Instance
|
||
|
|
||
|
|
||
|
def test_example():
|
||
|
i = Instance(Path("example"))
|
||
|
|
||
|
assert i.config is not None
|
||
|
assert len(list(i.projects)) == 1
|
||
|
|
||
|
p = next(i.projects)
|
||
|
|
||
|
assert p.directory == Path("example/hello-world.project")
|
||
|
|
||
|
|
||
|
def test_empty():
|
||
|
i = Instance()
|
||
|
|
||
|
assert i.directory == Path(".")
|
||
|
assert i.config is not None
|
||
|
assert len(list(i.projects)) == 0
|
||
|
|
||
|
|
||
|
def test_no_such_dir():
|
||
|
nonexistent_path = Path("nonexistent")
|
||
|
i = Instance(nonexistent_path)
|
||
|
|
||
|
assert i.directory == nonexistent_path
|
||
|
assert i.config is not None
|
||
|
assert len(list(i.projects)) == 0
|