Skip to content

Commit

Permalink
Revise test temp folder
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-f committed Dec 8, 2024
1 parent ade17fa commit 0386354
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# testing temporary folders
test/temp*
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_network(fname=sample_networks[0]):
return os.path.join(os.path.dirname(__file__), "test_data", fname)


def check_compare(fp_n1, fp_n2, fp_out="tmp.txt"):
def check_compare(fp_n1, fp_n2, fp_out="test/temp/tmp.txt"):
"""
Utility function to compare two netCDF files and check if they are the same.
Expand Down
5 changes: 4 additions & 1 deletion test/test_io.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from conftest import get_network, check_compare
import smspy
import os


def test_load_save_network():
fp_n1 = get_network()
fp_n2 = "resaved_file.nc4"
fp_n2 = "test/temp/resaved_file.nc4"
os.makedirs(os.path.dirname(fp_n2), exist_ok=True)

# Load a sample network
net = smspy.SMSNetwork(fp_n1)
# Save the network to a temporary file
Expand Down

0 comments on commit 0386354

Please sign in to comment.