コード例 #1
0
 def test_address(self):
     s = Server(("address", 22))
     s.address = ("example.com", 443)
     s.state = ConnectionState.OPEN
     with pytest.raises(RuntimeError):
         s.address = ("example.com", 80)
     # No-op assignment, allowed because it might be triggered by a Server.set_state() call.
     s.address = ("example.com", 443)
コード例 #2
0
ファイル: test_connection.py プロジェクト: adibdz/mitmproxy
 def test_address(self):
     s = Server(("address", 22))
     s.address = ("example.com", 443)
     s.state = ConnectionState.OPEN
     with pytest.raises(RuntimeError):
         s.address = ("example.com", 80)