def test_parsers(self):
        p = DRLCPPParser()
        s = p.serialize()
        p2 = Parser.deserialize(s)
        self.assert_bii_equal(p, p2)

        p = DRLCPPParser()
        s = p.serialize()
        p2 = Parser.deserialize(s)
        self.assert_bii_equal(p, p2)
Esempio n. 2
0
    def test_parsers(self):
        p = DRLCPPParser()
        s = p.serialize()
        p2 = Parser.deserialize(s)
        self.assert_bii_equal(p, p2)

        p = DRLCPPParser()
        s = p.serialize()
        p2 = Parser.deserialize(s)
        self.assert_bii_equal(p, p2)
Esempio n. 3
0
 def deserialize(self, data):
     '''From dictionary to object Content'''
     if data is None:
         return None
     try:
         return Content(id_=self.id_type.deserialize(data[Content.SERIAL_ID_KEY]),
                        load=Blob.deserialize(data[Content.SERIAL_LOAD_KEY]),
                        parser=Parser.deserialize(data[Content.SERIAL_PARSER_KEY]),
                        is_parsed=data[Content.SERIAL_IS_PARSED_KEY],
                        )
     except Exception as e:
         raise BiiSerializationException('Could not deserialize Content: %s' % str(e))
Esempio n. 4
0
 def deserialize(self, data):
     '''From dictionary to object Content'''
     if data is None:
         return None
     try:
         return Content(
             id_=self.id_type.deserialize(data[Content.SERIAL_ID_KEY]),
             load=Blob.deserialize(data[Content.SERIAL_LOAD_KEY]),
             parser=Parser.deserialize(data[Content.SERIAL_PARSER_KEY]),
             is_parsed=data[Content.SERIAL_IS_PARSED_KEY],
         )
     except Exception as e:
         raise BiiSerializationException(
             'Could not deserialize Content: %s' % str(e))