2020-05-12 01:53:08 +02:00
|
|
|
import os
|
2022-06-07 11:52:38 +02:00
|
|
|
from pathlib import Path
|
2020-05-12 01:53:08 +02:00
|
|
|
|
|
|
|
|
2021-08-30 00:43:28 +02:00
|
|
|
def make_file(path: str) -> None:
|
2020-05-12 01:53:08 +02:00
|
|
|
Path(path).touch()
|
|
|
|
|
|
|
|
|
2021-08-30 00:43:28 +02:00
|
|
|
def make_valid_symlink(path: str) -> None:
|
2020-05-12 01:53:08 +02:00
|
|
|
target = path + "1"
|
|
|
|
make_file(target)
|
|
|
|
os.symlink(target, path)
|
|
|
|
|
|
|
|
|
2021-08-30 00:43:28 +02:00
|
|
|
def make_broken_symlink(path: str) -> None:
|
2020-05-12 01:53:08 +02:00
|
|
|
os.symlink("foo", path)
|
|
|
|
|
|
|
|
|
2021-08-30 00:43:28 +02:00
|
|
|
def make_dir(path: str) -> None:
|
2020-05-12 01:53:08 +02:00
|
|
|
os.mkdir(path)
|