Added ability to add host to blocked table if visit count is exceeded

This commit is contained in:
2019-02-13 16:34:56 -05:00
parent 7ab1ca6ae0
commit 5a40a15f9c
2 changed files with 26 additions and 0 deletions
+8
View File
@@ -13,7 +13,15 @@ def test_proxy_block_page():
requests.get("http://httpbin.org", proxies={"http": http_proxy})
assert requests.get("http://httpbin.org", proxies={"http": http_proxy}).status_code == 403
# TODO - Use a sqlite driver here to check that httpbin.org is in the blocked table.
# Or mock the sqlite client.
def test_blocked_file():
"""
Tests that the host configured to be blocked is successfully blocked.
TODO - Mock the blocked file to be used by the proxy to not have to hardcode the host.
"""
resp = requests.get("http://wikipedia.org", proxies={"http": http_proxy})
assert resp.status_code == 403