예제 #1
0
def test_org_1():
    desc = {
        "name": [("Example Company","en"), ("Exempel AB","se"), "Example",],
        "display_name": ["Example AS", ("Voorbeeld AZ", "")],
        "url": [("http://example.com","en")],
    }
    org = metadata.do_organization_info(desc)
    print org
    assert isinstance(org, md.Organization)
    print org.keyswv()
    assert _eq(org.keyswv(), ['organization_name',
                'organization_display_name','organization_url'])
    assert len(org.organization_name) == 3
    assert len(org.organization_display_name) == 2
    assert len(org.organization_url) == 1
예제 #2
0
def test_org_2():
    desc = {
        "name": [("Example Company","en"), ("Exempel AB","se"), "Example",],
        "display_name": "Example AS",
        "url": ("http://example.com","en"),
    }
    org = metadata.do_organization_info(desc)
    print org
    assert _eq(org.keyswv(), ['organization_name',
                'organization_display_name','organization_url'])
    assert len(org.organization_name) == 3
    assert len(org.organization_display_name) == 1
    assert org.organization_display_name[0].text == 'Example AS'
    assert len(org.organization_url) == 1
    assert isinstance(org.organization_url[0], md.OrganizationURL)
    assert org.organization_url[0].lang == "en"
    assert org.organization_url[0].text == 'http://example.com'
예제 #3
0
def test_org_1():
    desc = {
        "name": [
            ("Example Company", "en"),
            ("Exempel AB", "se"),
            "Example",
        ],
        "display_name": ["Example AS", ("Voorbeeld AZ", "")],
        "url": [("http://example.com", "en")],
    }
    org = metadata.do_organization_info(desc)
    print org
    assert isinstance(org, md.Organization)
    print org.keyswv()
    assert _eq(
        org.keyswv(),
        ['organization_name', 'organization_display_name', 'organization_url'])
    assert len(org.organization_name) == 3
    assert len(org.organization_display_name) == 2
    assert len(org.organization_url) == 1
예제 #4
0
def test_org_2():
    desc = {
        "name": [
            ("Example Company", "en"),
            ("Exempel AB", "se"),
            "Example",
        ],
        "display_name": "Example AS",
        "url": ("http://example.com", "en"),
    }
    org = metadata.do_organization_info(desc)
    print org
    assert _eq(
        org.keyswv(),
        ['organization_name', 'organization_display_name', 'organization_url'])
    assert len(org.organization_name) == 3
    assert len(org.organization_display_name) == 1
    assert org.organization_display_name[0].text == 'Example AS'
    assert len(org.organization_url) == 1
    assert isinstance(org.organization_url[0], md.OrganizationURL)
    assert org.organization_url[0].lang == "en"
    assert org.organization_url[0].text == 'http://example.com'
예제 #5
0
def test_org_3():
    desc = { "display_name": ["Rolands SAML"] }
    org = metadata.do_organization_info(desc)
    assert _eq(org.keyswv(), ['organization_display_name'])
    assert len(org.organization_display_name) == 1
예제 #6
0
def test_org_3():
    desc = {"display_name": ["Rolands SAML"]}
    org = metadata.do_organization_info(desc)
    assert _eq(org.keyswv(), ['organization_display_name'])
    assert len(org.organization_display_name) == 1