forked from dlubal-software/RSTAB_Python_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_timberMoistureClass.py
More file actions
61 lines (48 loc) · 2.37 KB
/
Copy pathtest_timberMoistureClass.py
File metadata and controls
61 lines (48 loc) · 2.37 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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.enums import AddOn, TimberMoistureClassType
from RSTAB.initModel import Model, SetAddonStatus, AddOn, openFile, closeModel
from RSTAB.connectionGlobals import url
from RSTAB.BasicObjects.material import Material
from RSTAB.BasicObjects.crossSection import CrossSection
from RSTAB.BasicObjects.node import Node
from RSTAB.BasicObjects.member import Member
from RSTAB.TypesForTimberDesign.timberMoistureClass import TimberMoistureClass
from RSTAB.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations
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_timberMoistureClass():
dirname = os.path.join(os.getcwd(), os.path.dirname(__file__))
openFile(os.path.join(dirname, 'src', 'timberMoistureClass.rs9'))
Model.clientModel.service.delete_all()
Model.clientModel.service.begin_modification()
SetAddonStatus(Model.clientModel, AddOn.timber_design_active, True)
Node(1, 0, 0, 0)
Node(2, 5, 0, 0)
Material(1, 'KLH (20 mm) | KLH')
CrossSection(1, 'R_M1 0.2/0.5', 1)
Member(1, 1, 2, 0, 1, 1)
LoadCasesAndCombinations(
params = {
"current_standard_for_combination_wizard": 6226,
"combination_wizard_and_classification_active": True,
"combination_wizard_active": True,
"result_combinations_active": True,
"result_combinations_parentheses_active": False,
"result_combinations_consider_sub_results": False,
"combination_name_according_to_action_category": False})
TimberMoistureClass(no = 1, members='1', moisture_class=TimberMoistureClassType.TIMBER_MOISTURE_CLASS_TYPE_2)
Model.clientModel.service.finish_modification()
tmc = Model.clientModel.service.get_timber_moisture_class(1)
assert tmc.members == '1'
assert tmc.moisture_class == TimberMoistureClassType.TIMBER_MOISTURE_CLASS_TYPE_2.name
closeModel('timberMoistureClass.rs9')