Esempio n. 1
0
def test_optional_attributes():
    attrconverters = ac_factory("../tests/attributemaps")
    ras = metadata.do_requested_attribute(
        SP["service"]["sp"]["optional_attributes"], attrconverters)
    assert len(ras) == len(SP["service"]["sp"]["optional_attributes"])
    print ras[0]
    assert ras[0].name == 'urn:oid:2.5.4.12'
    assert ras[0].name_format == NAME_FORMAT_URI
    assert ras[0].is_required == "false"
Esempio n. 2
0
def test_optional_attributes():
    attrconverters = ac_factory("../tests/attributemaps")
    ras = metadata.do_requested_attribute(
                                SP["service"]["sp"]["optional_attributes"],
                                attrconverters)
    assert len(ras) == len(SP["service"]["sp"]["optional_attributes"])
    print ras[0]
    assert ras[0].name == 'urn:oid:2.5.4.12'
    assert ras[0].name_format == NAME_FORMAT_URI
    assert ras[0].is_required == "false"
Esempio n. 3
0
def test_attributes():
    required = ["surname", "givenname", "edupersonaffiliation"]
    ra = metadata.do_requested_attribute(required, ATTRCONV, "True")
    print ra
    assert ra
    assert len(ra) == 3
    for i in range(3):
        assert isinstance(ra[i], md.RequestedAttribute)
        assert ra[i].name_format == NAME_FORMAT_URI
        assert ra[i].attribute_value == []
        assert ra[i].is_required == "True"
    assert ra[0].friendly_name == "surname"
    assert ra[0].name == 'urn:oid:2.5.4.4'
Esempio n. 4
0
def test_attributes():
    required = ["surname", "givenname", "edupersonaffiliation"]
    ra = metadata.do_requested_attribute(required, ATTRCONV, "True")
    print ra
    assert ra
    assert len(ra) == 3
    for i in range(3):
        assert isinstance(ra[i], md.RequestedAttribute)
        assert ra[i].name_format == NAME_FORMAT_URI
        assert ra[i].attribute_value == []
        assert ra[i].is_required == "True"
    assert ra[0].friendly_name == "surname"
    assert ra[0].name == "urn:oid:2.5.4.4"