Пример #1
0
    def test_multiple(self):
        gate = AntiGate(API_KEY, auto_run=False)
        captcha_id1 = gate.send(IMAGE1)
        captcha_id2 = gate.send(IMAGE2)

        self.assertTrue(str(captcha_id1).isdigit())
        self.assertTrue(str(captcha_id2).isdigit())

        results = gate.get_multi([captcha_id1, captcha_id2])
        self.assertTrue(results == ['123', '456'])
Пример #2
0
    def test_multiple(self):
        gate = AntiGate(API_KEY, auto_run=False)
        captcha_id1 = gate.send(IMAGE1)
        captcha_id2 = gate.send(IMAGE2)

        self.assertTrue(str(captcha_id1).isdigit())
        self.assertTrue(str(captcha_id2).isdigit())

        results = gate.get_multi([captcha_id1, captcha_id2])
        self.assertTrue(results == ['123', '456'])
Пример #3
0
    def test_multiple_binary(self):
        gate = AntiGate(API_KEY, auto_run=False)
        captcha_id1 = gate.send(open(IMAGE1, 'rb').read(), binary=True)
        captcha_id2 = gate.send(open(IMAGE2, 'rb').read(), binary=True)

        self.assertTrue(str(captcha_id1).isdigit())
        self.assertTrue(str(captcha_id2).isdigit())

        results = gate.get_multi([captcha_id1, captcha_id2])

        #self.assertListEqual(results, ['123', '456'])
        self.assertTrue(results == ['123', '456'])
Пример #4
0
    def test_multiple_binary(self):
        gate = AntiGate(API_KEY, auto_run=False)
        captcha_id1 = gate.send(open(IMAGE1, 'rb').read(), binary=True)
        captcha_id2 = gate.send(open(IMAGE2, 'rb').read(), binary=True)

        self.assertTrue(str(captcha_id1).isdigit())
        self.assertTrue(str(captcha_id2).isdigit())

        results = gate.get_multi([captcha_id1, captcha_id2])

        #self.assertListEqual(results, ['123', '456'])
        self.assertTrue(results == ['123', '456'])
Пример #5
0
    def test_multiple_binary(self):
        gate = AntiGate(API_KEY, auto_run=False)
        fp1 = open(IMAGE1, 'rb')
        fp2 = open(IMAGE2, 'rb')
        captcha_id1 = gate.send(fp1.read())
        captcha_id2 = gate.send(fp2.read())
        fp1.close()
        fp2.close()

        self.assertTrue(str(captcha_id1).isdigit())
        self.assertTrue(str(captcha_id2).isdigit())

        results = gate.get_multi([captcha_id1, captcha_id2])
        self.assertTrue(results == ['123', '456'])
Пример #6
0
    def test_multiple_binary(self):
        gate = AntiGate(API_KEY, auto_run=False)
        fp1 = open(IMAGE1, 'rb')
        fp2 = open(IMAGE2, 'rb')
        captcha_id1 = gate.send(fp1.read())
        captcha_id2 = gate.send(fp2.read())
        fp1.close()
        fp2.close()

        self.assertTrue(str(captcha_id1).isdigit())
        self.assertTrue(str(captcha_id2).isdigit())

        results = gate.get_multi([captcha_id1, captcha_id2])
        self.assertTrue(results == ['123', '456'])