def test_post_file(henry_post_bucket): with open('/var/tmp/proxy_requests_testing.txt', 'w') as f_out: f_out.write('testing') r = ProxyRequests(henry_post_bucket + '/post') r.set_file('/var/tmp/proxy_requests_testing.txt') r.post_file() assert r.get_status_code() == 200 assert 'Thank you' in r.__str__() print(henry_post_bucket) print(r.get_proxy_used())
def test_post_file_with_headers(henry_post_bucket): with open('/var/tmp/proxy_requests_testing.txt', 'w') as f_out: f_out.write('testing') h = {'User-Agent': 'NCSA Mosaic/3.0 (Windows 95)'} r = ProxyRequests(henry_post_bucket + '/post') r.set_headers(h) r.set_file('/var/tmp/proxy_requests_testing.txt') r.post_file_with_headers() assert r.get_status_code() == 200 assert 'Thank you' in r.__str__() print(henry_post_bucket) print(r.get_proxy_used())