def test_parse_rate_response(self): with patch("purplship.mappers.fedex_express.proxy.http") as mock: mock.return_value = RateResponseXml parsed_response = Rating.fetch(self.RateRequest).from_(gateway).parse() self.assertEqual(DP.to_dict(parsed_response), DP.to_dict(ParsedRateResponse))
def test_get_rates(self, http_mock): Rating.fetch(self.RateRequest).from_(gateway) url = http_mock.call_args[1]["url"] self.assertEqual(url, f"{gateway.settings.server_url}/rate")