Skip to content

Commit

Permalink
Updating tests...ish
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhart committed Dec 19, 2023
1 parent 263b9d6 commit 1709f1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions wntr/epanet/msx/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
libepanet = resource_filename(__name__, "../Linux/libepanet2.so")
libmsx = resource_filename(__name__, "../Linux/libepanetmsx.so")

dylib_dir = os.environ.get('DYLD_FALLBACK_LIBRARY_PATH','')
if dylib_dir != '':
dylib_dir = dylib_dir + ':' + resource_filename(__name__, "../Darwin")
os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = dylib_dir

import logging

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -61,9 +66,9 @@ def __init__(self, inpfile="", rptfile="", binfile="", msxfile=""):
self.binfile = binfile
self.msxfile = msxfile

libnames = ["epanetmsx", "epanetmsx_win32"]
libnames = ["epanetmsx"]
if "64" in platform.machine():
libnames.insert(0, "epanetmsx_amd64")
libnames.insert(0, "epanetmsx")
if msx_toolkit:
for lib in libnames:
try:
Expand Down
7 changes: 4 additions & 3 deletions wntr/tests/test_epanet_msx_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ def test_msx_io(self):
wntr.epanet.InpFile().write("test.inp", wn_model)
wntr.epanet.msx.MsxFile().write("test.msx", msx_model)
msx_model2 = wntr.msx.MsxModel(msx_file_name="test.msx")
true_vars = ["AS3", "AS5", "AS5s", "AStot", "Av", "D", "Ff", "K1", "K2", "Ka", "Kb", "Kc", "Ks", "Len", "NH2CL", "Q", "Re", "Smax", "U", "Us"]
in_vars = msx_model.variable_name_list
true_vars = ["AS3", "AS5", "AS5s", "AStot", "NH2CL", "Ka", "Kb", "K1", "K2", "Smax", "Ks"]
true_vars.sort()
in_vars = msx_model.species_name_list + msx_model.constant_name_list + msx_model.parameter_name_list + msx_model.term_name_list
in_vars.sort()
io_vars = msx_model2.variable_name_list
io_vars = msx_model2.species_name_list + msx_model2.constant_name_list + msx_model2.parameter_name_list + msx_model2.term_name_list
io_vars.sort()
self.assertListEqual(true_vars, in_vars)
self.assertListEqual(true_vars, io_vars)
Expand Down

0 comments on commit 1709f1f

Please sign in to comment.