Browse Source

Using assert in tests

Fabrizio Furnari 1 month ago
parent
commit
e5ce64ac17
1 changed files with 4 additions and 0 deletions
  1. 4 0
      example_tests/03-basic_header_regex.py

+ 4 - 0
example_tests/03-basic_header_regex.py

@@ -1,3 +1,4 @@
+import re
 from pathlib import Path
 from pathlib import Path
 from httphound.main import BaseProxyTest, BackendConfig, ProxyConfig
 from httphound.main import BaseProxyTest, BackendConfig, ProxyConfig
 
 
@@ -27,6 +28,9 @@ class FailHeaderRegexTest(BaseProxyTest):
 
 
     async def run_test(self):
     async def run_test(self):
         await self.make_request()
         await self.make_request()
+        print(self.response_headers)
+        assert "x-test" in self.response_headers
+        assert re.match(r"\d{1}$", self.response_headers["x-test"])
         return True
         return True