Skip to content

Commit

Permalink
Revert "Adds expandobject=True to testrunners to assert tests"
Browse files Browse the repository at this point in the history
This reverts commit fd8789c.
  • Loading branch information
samuelduchesne committed Aug 20, 2019
1 parent 79db7d1 commit a0d2ef5
Showing 1 changed file with 26 additions and 70 deletions.
96 changes: 26 additions & 70 deletions eppy/tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,65 +223,33 @@ def setup(self):
"eplustbl.htm",
"sqlite.err",
]
self.expected_files_prefix = [
"sqlite.err",
"testout.audit",
"testout.bnd",
"testout.eio",
"testout.end",
"testout.err",
"testout.eso",
"testout.expidf",
"testout.mdd",
"testout.mtd",
"testout.rdd",
"testout.shd",
"testtbl.htm",
]
self.expected_files_suffix_C = [
"eplus.audit",
"eplus.bnd",
"eplus.eio",
"eplus.end",
"eplus.err",
"eplus.eso",
"eplus.expidf",
"eplus.mdd",
"eplus.mtd",
"eplus.rdd",
"eplus.shd",
"eplus.err",
"eplusSqlite.err",
"eplus.eio",
"eplusTable.htm",
"eplus.shd",
"eplus.mtd",
"eplus.bnd",
"eplus.eso",
"eplus.rdd",
"eplus.end",
]
self.expected_files_suffix_D = [
"eplus.audit",
"eplus.mdd",
"eplus-sqlite.err",
"eplus-table.htm",
"eplus.audit",
"eplus.bnd",
"eplus.err",
"eplus.eio",
"eplus.bnd",
"eplus.shd",
"eplus.mtd",
"eplus.end",
"eplus.err",
"eplus.eso",
"eplus.expidf",
"eplus.mdd",
"eplus.mtd",
"eplus.rdd",
"eplus.shd",
]
self.expected_files_suffix_L = [
"eplusout.audit",
"eplusout.bnd",
"eplusout.eio",
"eplusout.end",
"eplusout.err",
"eplusout.eso",
"eplusout.expidf",
"eplusout.mdd",
"eplusout.mtd",
"eplusout.rdd",
"eplusout.shd",
"eplustbl.htm",
"sqlite.err",
]

def teardown(self):
Expand Down Expand Up @@ -334,12 +302,7 @@ def test_run_annual(self, test_idf):
"""
test_idf.idfobjects["RUNPERIOD"][0].End_Month = 1
test_idf.run(
annual=True,
readvars=True,
output_directory="run_outputs",
expandobjects=True,
)
test_idf.run(annual=True, readvars=True, output_directory="run_outputs")
assert not has_severe_errors()
files = os.listdir("run_outputs")
self.expected_files.extend(["eplusout.rvaudit", "eplusout.csv"])
Expand Down Expand Up @@ -431,35 +394,30 @@ def test_run_output_prefix(self, test_idf):
Fails on severe errors or unexpected/missing output files.
"""
test_idf.run(
output_prefix="test", output_directory="run_outputs", expandobjects=True
)
test_idf.run(output_prefix="test", output_directory="run_outputs")
assert not has_severe_errors()
files = os.listdir("run_outputs")
assert set(files) == set(self.expected_files_prefix)
prefixed_files = [f.replace("eplus", "test") for f in self.expected_files]
assert set(files) == set(prefixed_files)

def test_run_output_suffix_L(self, test_idf):
"""
End to end test of idf.run function with output suffix set.
Fails on severe errors or unexpected/missing output files.
"""
test_idf.run(
output_suffix="L", output_directory="run_outputs", expandobjects=True
)
test_idf.run(output_suffix="L", output_directory="run_outputs")
assert not has_severe_errors()
files = os.listdir("run_outputs")
assert set(files) == set(self.expected_files_suffix_L)
assert set(files) == set(self.expected_files)

def test_run_output_suffix_C(self, test_idf):
"""
End to end test of idf.run function with output suffix set.
Fails on severe errors or unexpected/missing output files.
"""
test_idf.run(
output_suffix="C", output_directory="run_outputs", expandobjects=True
)
test_idf.run(output_suffix="C", output_directory="run_outputs")
assert not has_severe_errors()
files = os.listdir("run_outputs")
assert set(files) == set(self.expected_files_suffix_C)
Expand All @@ -470,9 +428,7 @@ def test_run_output_suffix_D(self, test_idf):
Fails on severe errors or unexpected/missing output files.
"""
test_idf.run(
output_suffix="D", output_directory="run_outputs", expandobjects=True
)
test_idf.run(output_suffix="D", output_directory="run_outputs")
assert not has_severe_errors()
files = os.listdir("run_outputs")
assert set(files) == set(self.expected_files_suffix_D)
Expand Down Expand Up @@ -528,10 +484,10 @@ def test_verbose(self, capfd, test_idf):
Fails if no output received from EnergyPlus.
"""
test_idf.run(verbose="v", output_directory="run_outputs", expandobjects=True)
test_idf.run(verbose="v", output_directory="run_outputs")
assert not has_severe_errors()
files = os.listdir("run_outputs")
self.expected_files.extend(["eplusout.expidf"])
self.expected_files.extend([])
assert set(files) == set(self.expected_files)
out, _err = capfd.readouterr()
assert len(out) > 0
Expand All @@ -543,10 +499,10 @@ def test_quiet(self, capfd, test_idf):
Fails if output received from EnergyPlus.
"""
test_idf.run(verbose="q", output_directory="run_outputs", expandobjects=True)
test_idf.run(verbose="q", output_directory="run_outputs")
assert not has_severe_errors()
files = os.listdir("run_outputs")
self.expected_files.extend(["eplusout.expidf"])
self.expected_files.extend([])
assert set(files) == set(self.expected_files)
out, _err = capfd.readouterr()
assert len(out) == 0
Expand Down

0 comments on commit a0d2ef5

Please sign in to comment.