コード例 #1
0
def test_is_handle():

    assert STCObject.is_handle('portx') == False

    portObject = STCObject.create('port', under='project1')

    assert STCObject.is_handle(portObject.handle)
コード例 #2
0
def test_active():

    portObject = STCObject.create('port', under='project1')
    assert portObject.active == 'true'

    portObject.active = 'false'
    assert portObject.active == 'false'
コード例 #3
0
def test_name():

    projectObject = STCObject.create('project')
    assert projectObject.name == 'Project 1'

    projectObject.name = 'xx'

    assert projectObject.name == 'xx'
コード例 #4
0
def test_children():
    systemObject = STCObject('system1')
    rprObject = STCObject('resultproviderregistry1')
    print([child.handle for child in rprObject.children])
コード例 #5
0
def test_attributes():
    systemObject = STCObject('system1')
    assert 'Active' in systemObject.attributes
    assert 'Name' in systemObject.attributes
    assert 'Version' in systemObject.attributes
    assert 'children' in systemObject.attributes
コード例 #6
0
def test_parent():
    systemObject = STCObject('system1')
    assert systemObject.parent == None

    projectObject = STCObject('project1')
    assert projectObject.parent.handle == 'system1'
コード例 #7
0
def test_handle():
    systemObject = STCObject('system1')
    assert systemObject.handle == 'system1'
コード例 #8
0
def test_create():
    portObject = STCObject.create('port', under='project1')
    assert portObject.parent.handle == 'project1'
コード例 #9
0
def test_type():
    projectObject = STCObject.create('project')
    assert projectObject.type == 'project'