forked from dlubal-software/RFEM_Python_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_htmlReport.py
More file actions
27 lines (23 loc) · 862 Bytes
/
Copy pathtest_htmlReport.py
File metadata and controls
27 lines (23 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import sys
import os
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__),
os.pardir)
)
sys.path.append(PROJECT_ROOT)
from RFEM.Reports.html import ExportResultTablesToHtml
from RFEM.initModel import Model
from shutil import rmtree
if Model.clientModel is None:
Model()
def test_html_report():
Model.clientModel.service.delete_all()
Model.clientModel.service.run_script('..\\scripts\\internal\\Demos\\Demo-003 Castellated Beam.js')
Model.clientModel.service.calculate_all(False)
dirname = os.path.join(os.getcwd(), os.path.dirname(__file__))
# Remove any previous results if they exist
folderPath = os.path.join(dirname, 'testResults')
if os.path.isdir(folderPath):
rmtree(folderPath)
ExportResultTablesToHtml(folderPath)
assert os.path.exists(folderPath)