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
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'
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
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'
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
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