Skip to content

Commit

Permalink
Auto-format code using Clang-Format (#282)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
github-actions[bot] and actions-user authored Nov 23, 2024
1 parent 50c801d commit 6830146
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/integration/test_waccm_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
from acom_music_box.tools.waccmToMusicBox import main as waccmToMusicBoxMain
from acom_music_box import Examples


@pytest.fixture
def temp_dir():
with tempfile.TemporaryDirectory() as tmpdirname:
yield tmpdirname


def get_repo_root():
return os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))


def run_waccm_to_music_box_with_args(args, cwd):
original_argv = sys.argv
original_cwd = os.getcwd()
Expand All @@ -24,10 +27,11 @@ def run_waccm_to_music_box_with_args(args, cwd):
os.chdir(original_cwd)
sys.argv = original_argv


def test_waccm_to_music_box_conversion(temp_dir):
repo_root = get_repo_root()
sample_data_dir = os.path.join(repo_root, "sample_waccm_data")

# Set up arguments for the conversion
args = [
f"waccmDir={sample_data_dir}",
Expand All @@ -37,10 +41,10 @@ def test_waccm_to_music_box_conversion(temp_dir):
"longitude=101.7",
"output=csv,json"
]

# Run the waccmToMusicBox script with the arguments
run_waccm_to_music_box_with_args(args, temp_dir)

# Check if the output files are created
assert os.path.exists(os.path.join(os.path.dirname(Examples.TS1.path), "initial_conditions.csv"))
assert os.path.exists(os.path.join(os.path.dirname(Examples.TS1.path), "initial_config.json"))
Expand Down

0 comments on commit 6830146

Please sign in to comment.