title: How to unit test code that makes HTTP requests with twisted.web.client.Agent?
body: <p>I'm looking for hints or examples that illustrate how to unit test code that makes HTTP requests using twisted.web.client.Agent.</p>
  
  <p>Is it possible to use the real Agent in tests and configure it to connect to a fake HTTP server using StringTransport (no real TCP connetion)?</p>
  
  <p>Or is it better to mock out the Agent and inject a mock into classes that use the Agent?</p>