TRANSFER WORK
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Olivier 'reivilibre <olivier@librepush.net>
This commit is contained in:
Olivier 'reivilibre' 2021-07-20 10:16:12 +01:00
parent 761c4f6467
commit 3d7803b0d6
4 changed files with 35 additions and 3 deletions

View File

@ -1,6 +1,30 @@
import time
from pathlib import Path
from random import Random
from tempfile import TemporaryDirectory
from unittest import TestCase
from helpers import generate_random_dir
from helpers.datman_helpers import set_up_simple_datman
from helpers.yama_helpers import set_up_simple_yama
class TestBackupAndExtract(TestCase):
def test_backup_one_full(self):
pass
td = TemporaryDirectory("test_backup_one_full")
tdpath = Path(td.name)
datman_path = tdpath.joinpath("datman")
src_path = datman_path.joinpath("srca")
yama_path = datman_path.joinpath("main")
set_up_simple_datman(datman_path)
set_up_simple_yama(yama_path)
rng = Random()
seed = rng.randint(0, 9001)
print(f"seed: {seed}")
rng.seed(seed)
generate_random_dir(rng, src_path, 64)
time.sleep(600)

View File

@ -7,9 +7,10 @@ def get_hostname():
def set_up_simple_datman(path: Path):
path.mkdir(exist_ok=True)
subprocess.check_call(("datman", "init"), cwd=path)
with path.joinpath("").open("a") as file:
with path.joinpath("datman.toml").open("a") as file:
file.write(f"""
[source.srca]
directory = "{path.joinpath("srca")}"

View File

@ -0,0 +1,7 @@
import subprocess
from pathlib import Path
def set_up_simple_yama(path: Path):
path.mkdir(exist_ok=True)
subprocess.check_call(("yama", "init"), cwd=path)

View File

@ -14,7 +14,7 @@ DESCRIPTION = "test suite for yama and datman"
URL = "https://bics.ga/reivilibre/yama"
EMAIL = "reivi@librepush.net"
AUTHOR = "Olivier 'reivilibre'"
REQUIRES_PYTHON = ">=3.8.0"
REQUIRES_PYTHON = ">=3.9.0"
VERSION = "0.0.0"
# What packages are required for this module to be executed?