modified:   eppy/tests/test_easyopen.py - made test generic
@@ -12,21 +12,35 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
+import os
import pytest
+
from eppy import modeleditor
import eppy.easyopen as easyopen
from eppy.pytest_helpers import do_integration_tests
+import eppy.runner.run_functions as run_functions
from six import StringIO
from six.moves import reload_module as reload
+def _latestidd():
+ """extract the latest idd installed"""
+ pth, _ = run_functions.install_paths('8.8.0')
+ dirpth = os.path.dirname(pth)
+ dirpth = os.path.dirname(dirpth)
+ alldirs = os.listdir( u'/Applications')
+ eplusdirs = [dir for dir in alldirs if dir.startswith('EnergyPlus')]
+ maxapp = max(eplusdirs)
+ splitapp = maxapp.split('-')
+ ver = '.'.join(splitapp[1:])
+ return ver
+
@pytest.mark.skipif(
not do_integration_tests(), reason="$EPPY_INTEGRATION env var not set")
def test_easyopen():
"""py.test for easyopen"""
- data = ((" Version,8.8;", '8.8'), # txt, result
- )
- for txt, result in data:
+ ver = _latestidd()
+ txt, result = (" Version,{};".format(ver), '{}'.format(ver))
fhandle = StringIO(txt)
reload(modeleditor)
reload(easyopen)
@@ -34,8 +48,5 @@ def test_easyopen():
versions = idf.idfobjects['version'.upper()]
version = versions[0]
ver = version.Version_Identifier
- # reload(modeleditor)
- # reload(IDF)
- # reload(idf_helpers)
assert result == ver
\ No newline at end of file
