Ejemplo n.º 1
0
def test_normal_c14n(test):
    try:
        print "-----8<----------8<----------8<----------8<----------8<----------8<----- test_normal_c14n()"
        print "First Object:\n" + repr(test) + "\n\n"
        serialized = pyxser.serialize_c14n(obj=test, depth=0, com=0)
        print "Serilized Object:\n" + serialized
        print "First Object:\n" + repr(test) + "\n\n"
        print "Serilized Object Validation:\n", \
              pyxser.validate_c14n(obj = serialized, enc = "ascii"), \
              pyxser.validate_c14n_dtd(obj = serialized, enc = "ascii")
        unserialized = pyxser.unserialize(obj=serialized, enc="ascii")
        print "Unserialized Object:\n" + repr(unserialized) + "\n\n"

        serialized = pyxser.serialize_c14n_strict(obj=test, depth=0, com=0)
        print "Serilized Object:\n" + serialized
        print "Serilized Object Validation:\n", pyxser.validate_c14n(
            obj=serialized, enc="ascii")
        print "First Object:\n" + repr(test) + "\n\n"

        pyxser.xmlcleanup()

    except Exception, e:
        print "-" * 60
        traceback.print_exc(file=sys.stdout)
        print "-" * 60
Ejemplo n.º 2
0
def test_all(test):
    try:
        serialized = pyxser.serialize(obj = test, enc = "utf-8", typemap = test_typemap_map, selector = sel)
        pyxser.validate(obj = serialized, enc = "utf-8")
        pyxser.validate_dtd(obj = serialized, enc = "utf-8")
        unserialized = pyxser.unserialize(obj = serialized, enc = "utf-8", cinit = False)

        serialized = pyxser.serialize_c14n(obj = test, depth = 0, com = 0)
        pyxser.validate_c14n(obj = serialized, enc = "utf-8")
        pyxser.validate_c14n_dtd(obj = serialized, enc = "utf-8")

        serialized = pyxser.u_serialize(obj = test, enc = "utf-8", typemap = test_typemap_map, selector = sel)
        pyxser.u_validate(obj = serialized, enc = "utf-8")
        pyxser.u_validate_dtd(obj = serialized, enc = "utf-8")
        unserialized = pyxser.u_unserialize(obj = serialized, enc = "utf-8", cinit = False)

        serialized = pyxser.u_serialize_c14n(obj = test, depth = 0, com = 0)
        pyxser.u_validate_c14n(obj = serialized, enc = "utf-8")
        pyxser.u_validate_c14n_dtd(obj = serialized, enc = "utf-8")

        pyxser.getdtd()
        pyxser.getdtd_c14n()
        pyxser.xmlcleanup()

    except Exception, e:
        print "-" * 60
        traceback.print_exc(file=sys.stdout)
        print "-" * 60
Ejemplo n.º 3
0
def test_all(test):
    try:
        serialized = pyxser.serialize(obj=test,
                                      enc="utf-8",
                                      typemap=test_typemap_map,
                                      selector=sel)
        pyxser.validate(obj=serialized, enc="utf-8")
        pyxser.validate_dtd(obj=serialized, enc="utf-8")
        unserialized = pyxser.unserialize(obj=serialized, enc="utf-8")

        serialized = pyxser.serialize_c14n(obj=test, depth=0, com=0)
        pyxser.validate_c14n(obj=serialized, enc="utf-8")
        pyxser.validate_c14n_dtd(obj=serialized, enc="utf-8")

        serialized = pyxser.u_serialize(obj=test,
                                        enc="utf-8",
                                        typemap=test_typemap_map,
                                        selector=sel)
        pyxser.u_validate(obj=serialized, enc="utf-8")
        pyxser.u_validate_dtd(obj=serialized, enc="utf-8")
        unserialized = pyxser.u_unserialize(obj=serialized, enc="utf-8")

        serialized = pyxser.u_serialize_c14n(obj=test, depth=0, com=0)
        pyxser.u_validate_c14n(obj=serialized, enc="utf-8")
        pyxser.u_validate_c14n_dtd(obj=serialized, enc="utf-8")

        pyxser.getdtd()
        pyxser.getdtd_c14n()
        pyxser.xmlcleanup()

    except Exception, e:
        print "-" * 60
        traceback.print_exc(file=sys.stdout)
        print "-" * 60
Ejemplo n.º 4
0
def test_normal_c14n(test):
    try:
        serialized = pyxser.serialize_c14n(obj=test, depth=0, com=0)
        pyxser.validate_c14n(obj=serialized, enc="utf-8")
        pyxser.validate_c14n_dtd(obj=serialized, enc="utf-8")
        unserialized = pyxser.unserialize(obj=serialized, enc="utf-8")

        serialized = pyxser.serialize_c14n_strict(obj=test, depth=0, com=0)
        pyxser.validate_c14n(obj=serialized, enc="utf-8")

        pyxser.xmlcleanup()

    except Exception, e:
        print "-" * 60
        traceback.print_exc(file=sys.stdout)
        print "-" * 60
Ejemplo n.º 5
0
def test_normal_c14n(test):
    try:
        serialized = pyxser.serialize_c14n(obj = test, depth = 0, com = 0)
        pyxser.validate_c14n(obj = serialized, enc = "utf-8")
        pyxser.validate_c14n_dtd(obj = serialized, enc = "utf-8")
        unserialized = pyxser.unserialize(obj = serialized, enc = "utf-8")

        serialized = pyxser.serialize_c14n_strict(obj = test, depth = 0, com = 0)
        pyxser.validate_c14n(obj = serialized, enc = "utf-8")

        pyxser.xmlcleanup()

    except Exception, e:
        print "-" * 60
        traceback.print_exc(file=sys.stdout)
        print "-" * 60
Ejemplo n.º 6
0
def test_normal_c14n(test):
    try:
        print("-----8<----------8<----------8<----------8<----------8<----------8<----- test_normal_c14n()")
        print("First Object:\n" + repr(test) + "\n\n")
        serialized = pyxser.serialize_c14n(obj = test, depth = 0, com = 0)
        print("Serilized Object:\n" + serialized)
        print("First Object:\n" + repr(test) + "\n\n")
        print("Serilized Object Validation:\n", \
              pyxser.validate_c14n(obj = serialized, enc = "utf-8"), \
              pyxser.validate_c14n_dtd(obj = serialized, enc = "utf-8"))
        unserialized = pyxser.unserialize(obj = serialized, enc = "utf-8")
        print("Unserialized Object:\n" + repr(unserialized) + "\n\n")

        serialized = pyxser.serialize_c14n_strict(obj = test, depth = 0, com = 0)
        print("Serilized Object:\n" + serialized)
        print("Serilized Object Validation:\n", pyxser.validate_c14n(obj = serialized, enc = "utf-8"))
        print("First Object:\n" + repr(test) + "\n\n")

        pyxser.xmlcleanup()

    except Exception:
        print("-" * 60)
        traceback.print_exc(file=sys.stdout)
        print("-" * 60)