Ejemplo n.º 1
0
 def test_roundtrip_server(self):
     s = tflow.tserver_conn()
     del s.reply
     s.wfile = None
     s.rfile = None
     ps = protobuf._dump_http_server_conn(s)
     ls = protobuf._load_http_server_conn(ps)
     assert s.__dict__ == ls.__dict__
Ejemplo n.º 2
0
 def test_roundtrip_server(self):
     s = tflow.tserver_conn()
     del s.reply
     s.wfile = None
     s.rfile = None
     ps = protobuf._dump_http_server_conn(s)
     ls = protobuf._load_http_server_conn(ps)
     assert s.__dict__ == ls.__dict__
Ejemplo n.º 3
0
 def test_roundtrip_server_cert(self, tdata):
     s = tflow.tserver_conn()
     del s.reply
     s.wfile = None
     s.rfile = None
     with open(tdata.path("mitmproxy/net/data/text_cert"), "rb") as f:
         d = f.read()
     s.cert = certs.Cert.from_pem(d)
     ps = protobuf._dump_http_server_conn(s)
     ls = protobuf._load_http_server_conn(ps)
     assert s.__dict__ == ls.__dict__
Ejemplo n.º 4
0
 def test_roundtrip_server_cert(self, tdata):
     s = tflow.tserver_conn()
     del s.reply
     s.wfile = None
     s.rfile = None
     with open(tdata.path("mitmproxy/net/data/text_cert"), "rb") as f:
         d = f.read()
     s.cert = certs.Cert.from_pem(d)
     ps = protobuf._dump_http_server_conn(s)
     ls = protobuf._load_http_server_conn(ps)
     assert s.__dict__ == ls.__dict__