def test_generic_deserialize(name): filename = path.join(BASE_DIR, '%s-simple.xml' % name) parser = etree.XMLParser( ns_clean=True, remove_blank_text=True, remove_comments=True) target = etree.parse(filename, parser).getroot() build_fn_name = ('build-%s-simple' % name).replace('-', '_') expected = globals()[build_fn_name]().serialize() result = schema.deserialize(target).serialize() assert_node(expected, result)
def test_generic_deserialize(name): filename = path.join(BASE_DIR, '%s-simple.xml' % name) parser = etree.XMLParser(ns_clean=True, remove_blank_text=True, remove_comments=True) target = etree.parse(filename, parser).getroot() build_fn_name = ('build-%s-simple' % name).replace('-', '_') expected = globals()[build_fn_name]().serialize() result = schema.deserialize(target).serialize() assert_node(expected, result)
def test_generic_deserialize_outside_registry(): xml = build_authentication_request_simple().serialize() xml.tag = 'BadTagName' result = schema.deserialize(xml) assert result is None