Exemple #1
0
def test_is_attribute(descriptor, result):
    cd = ComponentDescriptor.ComponentDescriptor(descriptor)
    assert cd.is_attribute == result
Exemple #2
0
def test_has_attribute_V_raises(value, message):
    cd = ComponentDescriptor.ComponentDescriptor(value)
    with pytest.raises(ComponentDescriptor.
                       ExceptionComponentDescriptorAccessError) as err:
        cd.has_attribute_V
    assert err.value.args[0] == message
Exemple #3
0
def test_type(descriptor, result):
    cd = ComponentDescriptor.ComponentDescriptor(descriptor)
    assert cd.type == result
Exemple #4
0
def test_has_attribute_V(value, result):
    cd = ComponentDescriptor.ComponentDescriptor(value)
    assert cd.has_attribute_V == result
Exemple #5
0
def test_component_descriptor_eq():
    cd = ComponentDescriptor.ComponentDescriptor(0x00)
    assert cd == cd
    assert cd != 1
Exemple #6
0
def test_role(descriptor, result):
    cd = ComponentDescriptor.ComponentDescriptor(descriptor)
    assert cd.role == result
Exemple #7
0
def test_has_object_N(value, result):
    cd = ComponentDescriptor.ComponentDescriptor(value)
    assert cd.has_object_N == result
Exemple #8
0
def test_has_set_T(value, result):
    cd = ComponentDescriptor.ComponentDescriptor(value)
    assert cd.has_set_T == result
Exemple #9
0
def test_is_set(descriptor, result):
    cd = ComponentDescriptor.ComponentDescriptor(descriptor)
    assert cd.is_set == result
Exemple #10
0
def test_ctor_raises(value, message):
    with pytest.raises(
            ComponentDescriptor.ExceptionComponentDescriptorInit) as err:
        ComponentDescriptor.ComponentDescriptor(value)
    assert err.value.args[0] == message