Exemplo n.º 1
0
    def testWriteXMLFile(self):
        char = self._getCharacter()

        io = StringIO.StringIO()
        char.write(io)

        new_char = Character()
        new_char.read_string(io.getvalue())

        self.assertEquals(char, new_char)
Exemplo n.º 2
0
    def testReadXMLBZ2String(self):
        file = os.path.join(self.currdir, "data", "character.xml.bz2")
        file = open(file)
        string = file.read()
        file.close()
        
        char = Character()
        char.read_string(string, bz2=True)

        self._testReadXML(char)
Exemplo n.º 3
0
    def testWriteXMLFile(self):
        char = self._getCharacter()

        io = StringIO.StringIO()
        char.write(io)

        new_char = Character()
        new_char.read_string(io.getvalue())

        self.assertEquals(char, new_char)
Exemplo n.º 4
0
    def testReadXMLBZ2String(self):
        file = os.path.join(self.currdir, "data", "character.xml.bz2")
        file = open(file)
        string = file.read()
        file.close()

        char = Character()
        char.read_string(string, bz2=True)

        self._testReadXML(char)
Exemplo n.º 5
0
    def testReadXMLString(self):
        file = os.path.join(self.currdir, "data", "character.xml")
        
        f = open(file)
        buf = f.read()
        f.close()
        
        char = Character()
        char.read_string(buf)

        self._testReadXML(char)
Exemplo n.º 6
0
    def testReadXMLString(self):
        file = os.path.join(self.currdir, "data", "character.xml")

        f = open(file)
        buf = f.read()
        f.close()

        char = Character()
        char.read_string(buf)

        self._testReadXML(char)
Exemplo n.º 7
0
def _convert_character(data):
    # converts a BLOB into an object
    char = Character()
    char.read_string(base64.b64decode(data), gzip=True)
    return char
Exemplo n.º 8
0
def _convert_character(data):
    # converts a BLOB into an object
    char = Character()
    char.read_string(base64.b64decode(data), gzip=True)
    return char