forked from dlubal-software/RSTAB_Python_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_GetAllObjects.py
More file actions
28 lines (23 loc) · 1 KB
/
Copy pathtest_GetAllObjects.py
File metadata and controls
28 lines (23 loc) · 1 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
import os
import sys
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__),
os.pardir)
)
sys.path.append(PROJECT_ROOT)
from RSTAB.initModel import Model
from RSTAB.connectionGlobals import url
from RSTAB.Tools.GetObjectNumbersByType import GetAllObjects
from tools import getPathToRunningRSTAB
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_GetAllObjects():
Model.clientModel.service.delete_all()
Model.clientModel.service.run_script(os.path.join(getPathToRunningRSTAB(), 'scripts\\internal\\Demos\\Demo-002 Cantilever Beams.js'))
objects, imports = GetAllObjects()
assert len(imports) == 13
assert len(objects) == 20