save a file to alocal folder and make it executable

This commit is contained in:
Stanislas Jouffroy 2025-03-04 00:06:09 +01:00
parent e54626d971
commit 230cf99f06
8 changed files with 122 additions and 21 deletions

View file

@ -1,9 +1,15 @@
import shutil
from pathlib import Path
import pytest
from majordome.github_service import GithubConnector
from majordome.settings import GithubSettings
from majordome.software_repo import SoftwareRepo
current_dir = Path(__file__).parent
github_settings = GithubSettings()
@ -13,7 +19,7 @@ def github_token():
@pytest.fixture
def project_url():
def freetube_url():
return "https://github.com/FreeTubeApp/FreeTube"
@ -34,14 +40,28 @@ def freetube_amd64_deb_mnemonic():
@pytest.fixture
def freetube_repo(
project_url,
freetube_url,
github_connector,
freetube_tag_name_mnemonic,
freetube_amd64_deb_mnemonic,
):
return SoftwareRepo(
project_url,
freetube_url,
github_connector,
freetube_tag_name_mnemonic,
freetube_amd64_deb_mnemonic,
)
@pytest.fixture
def clean_tmpdir():
rm_tmpdir()
yield
rm_tmpdir()
def rm_tmpdir():
print("teardown")
tmp_dir = current_dir / "tmp"
if tmp_dir.exists():
shutil.rmtree(tmp_dir)