Exemplo n.º 1
0
    def test_aionocaptcha_proxyless_context(self):
        with NoCaptchaTaskProxyless.aioNoCaptchaTaskProxyless(
                anticaptcha_key=self.anticaptcha_key) as nocaptcha:
            # check response type
            assert type(
                nocaptcha
            ) is python3_anticaptcha.NoCaptchaTaskProxyless.NoCaptchaTaskProxyless

            response = yield nocaptcha.captcha_handler(
                websiteURL='https://www.google.com/recaptcha/api2/demo',
                websiteKey='6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-')
        # check response type
        assert type(response) is dict
        # check all dict keys
        assert ['errorId', 'errorCode',
                'errorDescription'] == list(response.keys())
Exemplo n.º 2
0
    def test_fail_aionocaptcha_proxyless(self):
        nocaptcha = NoCaptchaTaskProxyless.aioNoCaptchaTaskProxyless(
            anticaptcha_key=self.anticaptcha_key_fail)
        # check response type
        assert type(nocaptcha) is NoCaptchaTaskProxyless.NoCaptchaTaskProxyless

        response = yield nocaptcha.captcha_handler(
            websiteURL="https://www.google.com/recaptcha/api2/demo",
            websiteKey="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
        )
        # check response type
        assert type(response) is dict
        # check all dict keys
        assert ["errorId", "errorCode",
                "errorDescription"] == list(response.keys())
        # check error code
        assert response["errorId"] == 1