示例#1
0
class SOCKS5DriverAUTHTestCase(TestMethodsMixin, AioTestCase):
    driver_class = Socks5Driver
    driver_kwargs = {
        "address": '127.0.0.1',
        "port": get_free_port(),
        "login": '******',
        "password": '******'
    }
示例#2
0
    def setUpClass(cls):
        super().setUpClass()
        # Configure mock server.
        cls.mock_server_port = get_free_port()
        cls.mock_server = HTTPServer(('localhost', cls.mock_server_port),
                                     MockServerRequestHandler)

        # Start running mock server in a separate thread.
        # Daemon threads automatically shut down when the main process exits.
        cls.mock_server_thread = Thread(target=cls.mock_server.serve_forever)
        cls.mock_server_thread.setDaemon(True)
        cls.mock_server_thread.start()

        cls.json_url = 'http://localhost:{port}/'.format(
            port=cls.mock_server_port)
示例#3
0
    def setUpClass(cls):
        super().setUpClass()
        # Configure mock server.
        cls.mock_server_port = get_free_port()
        cls.mock_server = HTTPServer(('localhost', cls.mock_server_port), VKRequestHandler)
        cls.mock_server.socket = ssl.wrap_socket(cls.mock_server.socket, server_side=True,
                                                 certfile=os.path.join(TEST_DIR, 'certs', 'cert.pem'),
                                                 keyfile=os.path.join(TEST_DIR, 'certs', 'key.pem'))

        # Start running mock server in a separate thread.
        # Daemon threads automatically shut down when the main process exits.
        cls.mock_server_thread = Thread(target=cls.mock_server.serve_forever)
        cls.mock_server_thread.setDaemon(True)
        cls.mock_server_thread.start()
        cls.base_url = 'localhost:{port}'.format(port=cls.mock_server_port)

        cls.json_url = 'https://{}/'.format(cls.base_url)
示例#4
0
class SOCKS5DriverANONTestCase(TestMethodsMixin, AioTestCase):
    driver_class = Socks5Driver
    driver_kwargs = {"address": '127.0.0.1', "port": get_free_port()}