Skip to content

Commit 0853ce2

Browse files
committed
Remove import aliases in test_examples.py, use sync_ prefixed names directly
https://claude.ai/code/session_01Pimg4VAco2v4srPeZj44Zm
1 parent b37d815 commit 0853ce2

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

tests/test_examples.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def missing_proxy(*args, **kwargs):
2222
class AntiGateTestCase(TestCase):
2323
@retry(tries=3)
2424
def test_process_antigate(self):
25-
from examples import sync_antigate as antigate
25+
from examples import sync_antigate
2626

27-
solution = antigate.process()
27+
solution = sync_antigate.process()
2828
for key in ["url", "domain", "localStorage", "cookies", "fingerprint"]:
2929
self.assertIn(key, solution)
3030

@@ -37,9 +37,9 @@ class FuncaptchaTestCase(TestCase):
3737
# Occasionally fails, so I repeat my attempt to have others selected.
3838
@retry(tries=3)
3939
def test_funcaptcha(self):
40-
from examples import sync_funcaptcha_request as funcaptcha_request
40+
from examples import sync_funcaptcha_request
4141

42-
self.assertIn("Solved!", funcaptcha_request.process())
42+
self.assertIn("Solved!", sync_funcaptcha_request.process())
4343

4444

4545
@pytest.mark.e2e
@@ -48,9 +48,9 @@ class RecaptchaRequestTestCase(TestCase):
4848
# Anticaptcha responds is not fully reliable.
4949
@retry(tries=6)
5050
def test_process(self):
51-
from examples import sync_recaptcha_request as recaptcha_request
51+
from examples import sync_recaptcha_request
5252

53-
self.assertIn(recaptcha_request.EXPECTED_RESULT, recaptcha_request.process())
53+
self.assertIn(sync_recaptcha_request.EXPECTED_RESULT, sync_recaptcha_request.process())
5454

5555

5656
@pytest.mark.e2e
@@ -60,9 +60,9 @@ class RecaptchaV3ProxylessTestCase(TestCase):
6060
# Anticaptcha responds is not fully reliable.
6161
@retry(tries=3)
6262
def test_process(self):
63-
from examples import sync_recaptcha3_request as recaptcha3_request
63+
from examples import sync_recaptcha3_request
6464

65-
self.assertTrue(recaptcha3_request.process()["success"])
65+
self.assertTrue(sync_recaptcha3_request.process()["success"])
6666

6767

6868
@contextmanager
@@ -84,7 +84,7 @@ class RecaptchaSeleniumtTestCase(TestCase):
8484
def test_process(self):
8585
from selenium.webdriver.chrome.options import Options
8686

87-
from examples import sync_recaptcha_selenium as recaptcha_selenium
87+
from examples import sync_recaptcha_selenium
8888

8989
options = Options()
9090
options.headless = True
@@ -93,16 +93,16 @@ def test_process(self):
9393
with open_driver(
9494
options=options,
9595
) as driver:
96-
self.assertIn(recaptcha_selenium.EXPECTED_RESULT, recaptcha_selenium.process(driver))
96+
self.assertIn(sync_recaptcha_selenium.EXPECTED_RESULT, sync_recaptcha_selenium.process(driver))
9797

9898

9999
@pytest.mark.e2e
100100
@missing_key
101101
class TextTestCase(TestCase):
102102
def test_process(self):
103-
from examples import sync_text as text
103+
from examples import sync_text
104104

105-
self.assertEqual(text.process(text.IMAGE).lower(), text.EXPECTED_RESULT.lower())
105+
self.assertEqual(sync_text.process(sync_text.IMAGE).lower(), sync_text.EXPECTED_RESULT.lower())
106106

107107

108108
@pytest.mark.e2e
@@ -111,9 +111,9 @@ def test_process(self):
111111
class HCaptchaTaskProxylessTestCase(TestCase):
112112
@retry(tries=3)
113113
def test_process(self):
114-
from examples import sync_hcaptcha_request as hcaptcha_request
114+
from examples import sync_hcaptcha_request
115115

116-
self.assertIn(hcaptcha_request.EXPECTED_RESULT, hcaptcha_request.process())
116+
self.assertIn(sync_hcaptcha_request.EXPECTED_RESULT, sync_hcaptcha_request.process())
117117

118118

119119
@pytest.mark.e2e
@@ -122,9 +122,9 @@ def test_process(self):
122122
class HCaptchaTaskTestCase(TestCase):
123123
@retry(tries=3)
124124
def test_process(self):
125-
from examples import sync_hcaptcha_request_proxy as hcaptcha_request_proxy
125+
from examples import sync_hcaptcha_request_proxy
126126

127127
self.assertIn(
128128
"Your request have submitted successfully.",
129-
hcaptcha_request_proxy.process(),
129+
sync_hcaptcha_request_proxy.process(),
130130
)

0 commit comments

Comments
 (0)