Implement blocking functionality after certain count of visits, added tests

This commit is contained in:
2019-01-27 21:29:10 -05:00
parent 9bb57aebfe
commit f8aa81be8d
4 changed files with 76 additions and 53 deletions
+5
View File
@@ -1,4 +1,5 @@
import requests
import os
# TODO - Make this configurable based on config file test section.
http_proxy = "http://127.0.0.1:8124"
@@ -7,4 +8,8 @@ def test_proxy_basic():
resp = requests.get("http://httpbin.org", proxies={"http": http_proxy})
assert resp.status_code == 200
def test_proxy_block_page():
for i in range(2):
requests.get("http://httpbin.org", proxies={"http": http_proxy})
assert requests.get("http://httpbin.org", proxies={"http": http_proxy}).status_code == 403