Skip to content

Commit

Permalink
Fixes asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonb5 committed May 17, 2024
1 parent 8bf1e19 commit 26e6f9f
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions CIME/tests/test_unit_system_tests_mvk.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

import re
import os
import json
import unittest
Expand Down Expand Up @@ -162,11 +163,19 @@ def test_config(case, run_dir, base_dir, evv_lib_dir):

expected_config = {
"20240515_212034_41b5u2": {
"module": "/opt/conda/lib/python3.10/site-packages/evv4esm/extensions/kso.py",
"component": "someother-comp",
}
}

module = config["20240515_212034_41b5u2"].pop("module")

assert (
re.search(
r"/opt/conda/lib/python.*/site-packages/evv4esm/extensions/kso.py",
module,
)
is not None
)
assert config == expected_config

nml_files = [x for x in os.listdir(temp_dir) if x.startswith("user_nl")]
Expand Down Expand Up @@ -229,7 +238,6 @@ def test_testmod_simple(self, evv, find_test_mods):

expected_config = {
"20240515_212034_41b5u2": {
"module": "/opt/conda/lib/python3.10/site-packages/evv4esm/extensions/ks.py",
"test-case": "Default",
"test-dir": f"{run_dir}",
"ref-case": "Reference",
Expand All @@ -241,6 +249,15 @@ def test_testmod_simple(self, evv, find_test_mods):
}
}

module = config["20240515_212034_41b5u2"].pop("module")

assert (
re.search(
r"/opt/conda/lib/python.*/site-packages/evv4esm/extensions/ks.py",
module,
)
is not None
)
assert config == expected_config

nml_files = [x for x in os.listdir(temp_dir) if x.startswith("user_nl")]
Expand Down Expand Up @@ -295,7 +312,6 @@ def test__compare_baseline(self, evv, append_testlog):

expected_config = {
"20240515_212034_41b5u2": {
"module": "/opt/conda/lib/python3.10/site-packages/evv4esm/extensions/ks.py",
"test-case": "Test",
"test-dir": f"{run_dir}",
"ref-case": "Baseline",
Expand All @@ -307,6 +323,15 @@ def test__compare_baseline(self, evv, append_testlog):
}
}

module = config["20240515_212034_41b5u2"].pop("module")

assert (
re.search(
r"/opt/conda/lib/python.*/site-packages/evv4esm/extensions/ks.py",
module,
)
is not None
)
assert config == expected_config

expected_comments = f"""BASELINE PASS for test '20240515_212034_41b5u2'.
Expand Down

0 comments on commit 26e6f9f

Please sign in to comment.