tests: Fix EXTRACT integration tests
This commit is contained in:
parent
57bdfef754
commit
727a6a8772
2 changed files with 7 additions and 3 deletions
|
|
@ -3,7 +3,10 @@ from .config import *
|
|||
|
||||
def evaluate_test(test, arg=None, name=None):
|
||||
try:
|
||||
test(arg)
|
||||
if arg:
|
||||
test(arg)
|
||||
else:
|
||||
test()
|
||||
print(f"{RESET}{BOLD}{name or test.__name__}: Success{RESET}")
|
||||
except AssertionError as e:
|
||||
print(f"{RESET}{BOLD}{name or test.__name__}: {RESET}{RED}Fail{RESET}")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import contextlib
|
||||
import logging
|
||||
import subprocess
|
||||
import time
|
||||
from os import path
|
||||
|
||||
from .config import *
|
||||
|
||||
|
|
@ -19,7 +19,8 @@ def run_image(file_name: str):
|
|||
@contextlib.contextmanager
|
||||
def extract_image(file_name: str):
|
||||
extract_dir = tempfile.mkdtemp(prefix="osbuild-")
|
||||
subprocess.run(["tar", "xf", f"{OUTPUT_DIR}/{file_name}"], cwd=extract_dir, check=True)
|
||||
archive = path.join(os.getcwd(), OUTPUT_DIR, file_name)
|
||||
subprocess.run(["tar", "xf", archive], cwd=extract_dir, check=True)
|
||||
try:
|
||||
yield extract_dir
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue