Exemplo n.º 1
0
    def test_tzinfo_copy(self):
        action = Action()
        action.timestamp = "2015-03-28T16:39:28.127296+03:00"
        action_xml = action.to_xml()

        action2 = Action.from_obj(parseString(action_xml))
        action2_copy = copy.deepcopy(action2)
        self.assertEqual(action_xml, action2_copy.to_xml())
Exemplo n.º 2
0
    def test_tzinfo_copy(self):
        action = Action()
        action.timestamp = "2015-03-28T16:39:28.127296+03:00"
        action_xml = action.to_xml(encoding=None)

        action2 = Action.from_obj(parseString(action_xml))
        action2_copy = copy.deepcopy(action2)
        self.assertEqual(action_xml, action2_copy.to_xml(encoding=None))
Exemplo n.º 3
0
    def test_round_trip_xml(self):
        np = NetworkPacket.from_dict(self._full_dict)
        xml = Observables(np).to_xml(encoding=None)

        new_obj = Observables.from_obj(parseString(xml))
        new_dict = new_obj.observables[0].object_.properties.to_dict()

        self.maxDiff = None
        self.assertEqual(self._full_dict, new_dict)
Exemplo n.º 4
0
    def test_round_trip_xml(self):
        np = NetworkPacket.from_dict(self._full_dict)
        xml = Observables(np).to_xml()

        new_obj = Observables.from_obj(parseString(xml))
        new_dict = new_obj.observables[0].object_.properties.to_dict()

        self.maxDiff = None
        self.assertEqual(self._full_dict, new_dict)