Exemplo n.º 1
0
    def test_parse_cancellation_pickup_response(self):
        with patch("purplship.mappers.dhl_express.proxy.http") as mock:
            mock.return_value = CancelPUResponseXML
            parsed_response = Pickup.cancel(
                self.CancelPURequest).from_(gateway).parse()

            self.assertEqual(DP.to_dict(parsed_response),
                             DP.to_dict(ParsedCancelPUResponse))
Exemplo n.º 2
0
    def test_parse_request_pickup_error(self):
        with patch("purplship.mappers.dhl_express.proxy.http") as mock:
            mock.return_value = PickupErrorResponseXML
            parsed_response = Pickup.schedule(
                self.BookPURequest).from_(gateway).parse()

            self.assertEqual(DP.to_dict(parsed_response),
                             DP.to_dict(ParsedPickupErrorResponse))
Exemplo n.º 3
0
    def test_parse_modify_pickup_response(self):
        with patch("purplship.mappers.dhl_express.proxy.http") as mock:
            mock.return_value = ModifyPURequestXML
            parsed_response = Pickup.update(
                self.ModifyPURequest).from_(gateway).parse()

            self.assertEqual(DP.to_dict(parsed_response),
                             DP.to_dict(ParsedModifyPUResponse))