mitmproxy/test/test_server.py

28 lines
542 B
Python
Raw Normal View History

import urllib, urllib2, unittest
import libpathod.test, requests
2011-03-05 22:21:31 +00:00
import tutils
class Sanity(tutils.ProxTest):
2011-03-05 22:21:31 +00:00
def test_http(self):
assert self.pathod("205").status_code == 205
assert self.log()
2011-03-05 22:21:31 +00:00
class TestHTTP(Sanity):
pass
class TestHTTPS(Sanity):
ssl = True
class TestProxy(tutils.ProxTest):
2011-03-05 22:21:31 +00:00
def test_http(self):
f = self.pathod("205")
assert f.status_code == 205
2011-03-05 22:21:31 +00:00
l = self.log()
assert l[0].address
assert "host" in l[1].headers
assert l[2].code == 205