Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions fre/pp/tests/test_configure_script_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ def test_configure_script():
old_home = os.environ["HOME"]
os.environ["HOME"] = str(Path(f"{TEST_DIR}/configure_yaml_out"))

# Set output directory
OUT_DIR = Path(f"{os.getenv('HOME')}/cylc-src/{EXPERIMENT}__{PLATFORM}__{TARGET}")
Path(OUT_DIR).mkdir(parents = True, exist_ok = True)

# Define combined yaml
model_yaml = f"{TEST_DIR}/{TEST_YAML}"
try:
# Set output directory
OUT_DIR = Path(f"{os.getenv('HOME')}/cylc-src/{EXPERIMENT}__{PLATFORM}__{TARGET}")
Path(OUT_DIR).mkdir(parents = True, exist_ok = True)

# Invoke configure_yaml_script.py
csy.yaml_info(model_yaml, EXPERIMENT, PLATFORM, TARGET)
# Define combined yaml
model_yaml = f"{TEST_DIR}/{TEST_YAML}"

os.environ["HOME"] = old_home
# Invoke configure_yaml_script.py
csy.yaml_info(model_yaml, EXPERIMENT, PLATFORM, TARGET)
finally:
os.environ["HOME"] = old_home

# Check for configuration creation and final combined yaml
assert all([ Path(f"{OUT_DIR}/{EXPERIMENT}.yaml").exists(),
Expand Down
16 changes: 10 additions & 6 deletions fre/tests/test_fre_pp_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ def test_cli_fre_pp_checkout_case():
directory = os.path.expanduser("~/cylc-src")+'/FOO__BAR__BAZ'
if Path(directory).exists():
shutil.rmtree(directory)
result = runner.invoke(fre.fre, args=["pp", "checkout",
"-e", "FOO",
"-p", "BAR",
"-t", "BAZ"] )
assert all( [ result.exit_code == 0,
Path(directory).exists()] )
try:
result = runner.invoke(fre.fre, args=["pp", "checkout",
"-e", "FOO",
"-p", "BAR",
"-t", "BAZ"] )
assert all( [ result.exit_code == 0,
Path(directory).exists()] )
finally:
if Path(directory).exists():
shutil.rmtree(directory)

#-- fre pp configure-yaml
def test_cli_fre_pp_configure_yaml():
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ test = [
"pylint",
"pytest",
]

[tool.pytest.ini_options]
norecursedirs = ["configure_yaml_out", "cylc-src", ".git", "__pycache__"]
Loading