-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest_GetAllObjects.py
28 lines (23 loc) · 1018 Bytes
/
test_GetAllObjects.py
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 RFEM.initModel import Model
from RFEM.connectionGlobals import url
from RFEM.Tools.GetObjectNumbersByType import GetAllObjects
import pytest
from tools import getPathToRunningRFEM
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(getPathToRunningRFEM(),'scripts\\internal\\Demos\\Demo-002 Cantilever Beams.js'))
objects, imports = GetAllObjects()
assert len(imports) > 18
assert len(objects) > 160