Skip to content

Commit

Permalink
fix indat test
Browse files Browse the repository at this point in the history
  • Loading branch information
je-cook committed Jan 17, 2025
1 parent af88440 commit 4b2a95a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/integration/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import logging
from pathlib import Path

import pytest

Expand Down Expand Up @@ -45,7 +46,7 @@ def input_file_path(temp_data):
return temp_data / "large_tokamak_IN.DAT"


def test_in_dat_lib(input_file_path):
def test_in_dat_lib(input_file_path, tmp_path):
"""Test the PROCESS in_dat library.
:param input_file_path: Path to a scenario's input file
Expand All @@ -54,8 +55,11 @@ def test_in_dat_lib(input_file_path):
logger.info("Testing in_dat")

# Test MFile for this scenario
try:
assert indat.test(str(input_file_path)) is True
except AssertionError:
logger.error(f"in_dat test for {input_file_path.name} has failed")
raise
"""Test function
:param f: file name to test
"""
outfile = Path(tmp_path, "test_out_IN.DAT")
i = indat.InDat(filename=str(input_file_path))
i.write_in_dat(output_filename=outfile.as_posix())

assert outfile.is_file()

0 comments on commit 4b2a95a

Please sign in to comment.