forked from dlubal-software/RSTAB_Python_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_htmlReport.py
More file actions
31 lines (27 loc) · 1.18 KB
/
Copy pathtest_htmlReport.py
File metadata and controls
31 lines (27 loc) · 1.18 KB
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
28
29
30
31
import sys
import os
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__),
os.pardir)
)
sys.path.append(PROJECT_ROOT)
from RSTAB.Reports.html import ExportResultTablesToHtml
from RSTAB.initModel import Model, url
from shutil import rmtree
import pytest
if Model.clientModel is None:
Model()
@pytest.mark.skipif(url != 'http://127.0.0.1', reason="This test fails on remote PC due to incorrect file path. \
Althought it is easy to change, it would not be easy to update on every remote computer.\
It is not necessary to evaluate Client as functional. Localy this tests still gets executed.")
def test_html_report():
Model.clientModel.service.delete_all()
Model.clientModel.service.run_script('..\\scripts\\internal\\Demos\\Demo-001 Hall.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)