some more work on testsuite before bed
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ccb021fb70
commit
761c4f6467
@ -23,6 +23,7 @@ class FileDescriptor:
|
||||
owner: int
|
||||
group: int
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True, frozen=True)
|
||||
class DirectoryDescriptor:
|
||||
contents: immutabledict[str, Union[FileDescriptor, "DirectoryDescriptor"]]
|
||||
@ -126,7 +127,8 @@ def scan_file(path: Path) -> FileDescriptor:
|
||||
|
||||
def scan_dir(path: Path) -> DirectoryDescriptor:
|
||||
contents = dict()
|
||||
for name in os.scandir(path):
|
||||
for entry in os.scandir(path):
|
||||
name = entry.name
|
||||
if name in ('.', '..'):
|
||||
continue
|
||||
filepath = path.joinpath(name)
|
||||
|
||||
21
testsuite/helpers/datman_helpers.py
Normal file
21
testsuite/helpers/datman_helpers.py
Normal file
@ -0,0 +1,21 @@
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_hostname():
|
||||
return subprocess.check_output("hostname").strip()
|
||||
|
||||
|
||||
def set_up_simple_datman(path: Path):
|
||||
subprocess.check_call(("datman", "init"), cwd=path)
|
||||
|
||||
with path.joinpath("").open("a") as file:
|
||||
file.write(f"""
|
||||
[source.srca]
|
||||
directory = "{path.joinpath("srca")}"
|
||||
hostname = "{get_hostname()}"
|
||||
|
||||
[piles.main]
|
||||
path = "main"
|
||||
included_labels = ["precious"]
|
||||
""")
|
||||
Loading…
x
Reference in New Issue
Block a user