01-simple.py 801 B

123456789101112131415161718192021222324252627
  1. from pathlib import Path
  2. from httphound.main import BaseProxyTest, ProxyConfig
  3. class BasicPassTest(BaseProxyTest):
  4. """Minimal test that will always pass.
  5. As for other tests the haproxy binary must be present somewhere
  6. on the filesystem.
  7. """
  8. def __init__(self):
  9. super().__init__()
  10. self.description = "Basic request"
  11. # Default address of proxy to listen is 127.0.0.1:4242
  12. self.url = "http://localhost:4242/"
  13. # Customize the haproxy path
  14. self.proxy_config = ProxyConfig(
  15. binary_path=Path.home() / "bin/haproxy"
  16. )
  17. async def run_test(self):
  18. """This is the bare minimum to run the test
  19. """
  20. await self.make_request()
  21. # Returning True as this must always pass
  22. return True