Пример #1
0
    def test_ipv4_secure_websocket_connection_by_router_url(
        self, config_path, router
    ):
        assert router.url == "wss://localhost:9443"

        try:
            ssl.PROTOCOL_TLSv1_2
        except AttributeError:
            pytest.skip('Python Environment does not support TLS')

        with DateService(
            url="wss://localhost:9443",
            cert_path="./wampy/testing/keys/server_cert.pem",
        ) as service:
            wait_for_registrations(service, 1)

            client = Client(
                url="wss://localhost:9443",
                cert_path="./wampy/testing/keys/server_cert.pem",
            )
            with client:
                wait_for_session(client)
                result = client.rpc.get_todays_date()

        today = date.today()

        assert result == today.isoformat()
Пример #2
0
    def test_ipv4_secure_websocket_connection_by_router_url(
            self, config_path, router):
        assert router.url == "wss://localhost:9443"

        try:
            ssl.PROTOCOL_TLSv1_2
        except AttributeError:
            pytest.skip('Python Environment does not support TLS')

        with DateService(
                url="wss://localhost:9443",
                cert_path="./wampy/testing/keys/server_cert.pem",
        ) as service:
            wait_for_registrations(service, 1)

            client = Client(
                url="wss://localhost:9443",
                cert_path="./wampy/testing/keys/server_cert.pem",
            )
            with client:
                wait_for_session(client)
                result = client.rpc.get_todays_date()

        today = date.today()

        assert result == today.isoformat()
Пример #3
0
    def test_ipv6_websocket_connection(self, config_path, router):
        service = DateService(url=router.url)
        with service:
            wait_for_registrations(service, 1)

            client = Client(url=router.url)

            with client:
                result = client.rpc.get_todays_date()

        today = date.today()

        assert result == today.isoformat()
Пример #4
0
    def test_ipv6_websocket_connection(self, config_path, router):
        service = DateService(url=router.url)
        with service:
            wait_for_registrations(service, 1)

            client = Client(url=router.url)

            with client:
                result = client.rpc.get_todays_date()

        today = date.today()

        assert result == today.isoformat()
Пример #5
0
    def test_ipv4_secure_websocket_connection_by_router_instance(
            self, config_path, router):
        try:
            ssl.PROTOCOL_TLSv1_2
        except AttributeError:
            pytest.skip('Python Environment does not support TLS')

        with DateService(router=router) as service:
            wait_for_registrations(service, 1)

            client = Client(router=router)
            with client:
                wait_for_session(client)
                result = client.rpc.get_todays_date()

        today = date.today()

        assert result == today.isoformat()