mirror of
https://github.com/infeeeee/dyn2py
synced 2025-12-16 22:16:18 +01:00
Update Tests
This commit is contained in:
@@ -3,15 +3,17 @@ import dyn2py
|
||||
|
||||
INPUT_DIR = "tests/input_files"
|
||||
OUTPUT_DIR = "tests/output_files"
|
||||
TEMP_DIR = "tests/temp_files"
|
||||
|
||||
|
||||
def cleanup_output_dir():
|
||||
output_dir = pathlib.Path(OUTPUT_DIR)
|
||||
if output_dir.exists():
|
||||
for f in output_dir.iterdir():
|
||||
f.unlink()
|
||||
else:
|
||||
output_dir.mkdir()
|
||||
def cleanup_dirs():
|
||||
for p in [OUTPUT_DIR, TEMP_DIR]:
|
||||
the_dir = pathlib.Path(p)
|
||||
if the_dir.exists():
|
||||
for f in the_dir.iterdir():
|
||||
f.unlink()
|
||||
else:
|
||||
the_dir.mkdir()
|
||||
|
||||
|
||||
def extract_single_node_dyn(modify_py: bool = False):
|
||||
@@ -23,7 +25,7 @@ def extract_single_node_dyn(modify_py: bool = False):
|
||||
modify_py (bool, optional): Also do some changes on the exported file. Defaults to False.
|
||||
|
||||
"""
|
||||
cleanup_output_dir()
|
||||
cleanup_dirs()
|
||||
|
||||
# Extract py:
|
||||
options = dyn2py.Options(python_folder=OUTPUT_DIR)
|
||||
|
||||
Reference in New Issue
Block a user