-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testing for hvac diagram, call PythonPlugin file from Python API, f…
- Loading branch information
1 parent
18b6ed1
commit 72e6b2d
Showing
7 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
from subprocess import check_call, CalledProcessError, STDOUT | ||
|
||
from ep_testing.exceptions import EPTestingException | ||
from ep_testing.tests.base import BaseTest | ||
|
||
|
||
class HVACDiagram(BaseTest): | ||
|
||
def name(self): | ||
return 'Test running 5ZoneAirCooled.idf, then HVACDiagram and make sure the SVG is created' | ||
|
||
def run(self, install_root: str, verbose: bool, kwargs: dict): | ||
idf_path = os.path.join(install_root, 'ExampleFiles', '5ZoneAirCooled.idf') | ||
print('* Running test class "%s" on file "%s"... ' % (self.__class__.__name__, '5ZoneAirCooled.idf'), end='') | ||
eplus_binary = os.path.join(install_root, 'energyplus') | ||
dev_null = open(os.devnull, 'w') | ||
try: | ||
check_call([eplus_binary, '-D', idf_path], stdout=dev_null, stderr=STDOUT) | ||
print(' [E+ FINISHED] ', end='') | ||
except CalledProcessError: | ||
raise EPTestingException('EnergyPlus failed!') | ||
hvac_diagram_binary = os.path.join(install_root, 'PostProcess', 'HVAC-Diagram') | ||
try: | ||
check_call([hvac_diagram_binary], stdout=dev_null, stderr=STDOUT) | ||
print(' [HVAC DIAGRAM FINISHED] ', end='') | ||
except CalledProcessError: | ||
raise EPTestingException('Transition failed!') | ||
if os.path.exists('eplusout.svg'): | ||
print(' [SVG FILE EXISTS] [DONE]!') | ||
else: | ||
raise EPTestingException('SVG Did not exist!') |