def test_session_from_environment(self): client = HttpClient() client.enable_cookies() client.post("http://something") spy = self.session_spy.attribute_spies["send"] args, kwargs = spy.call_history[-1] expect(kwargs).to(contain_key_with_value("proxies", {"http": self.http_proxy, "https": self.https_proxy}))
def test_sends_prepared_request(self): client = HttpClient() client.enable_cookies() client.post("http://pewpewpew") prep_spy = self.extract_prep_spy() prepped = prep_spy.return_value_spies[-1] send_spy = self.extract_send_spy() args, kwargs = send_spy.call_history[-1] expect(args[0]).to(be(prepped))