Skip to content

Commit

Permalink
tox & travis updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gotlium committed Jan 12, 2016
1 parent 75a5728 commit 3eeb0d5
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ install:
- pip install -r requirements/tests.txt --use-mirrors
- pip install -r requirements/package.txt --use-mirrors
before_script:
- flake8 antigate
- flake8 antigate --ignore F811
script:
- env ANTIGATE_HTTP_BACKEND=antigate.backends.requests_lib make test
- env ANTIGATE_HTTP_BACKEND=antigate.backends.urllib_lib make test
Expand Down
2 changes: 1 addition & 1 deletion antigate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

try:
from antigate.backends.grab_lib import Http
except ImportError, msg:
except ImportError:
try:
from antigate.backends.requests_lib import Http
except ImportError:
Expand Down
1 change: 0 additions & 1 deletion antigate/backends/grab_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class Http(object):
def __init__(self, **config):
print("> GrabLib")
self.grab = Grab(**(config or {}))

def get_response_body(self):
Expand Down
1 change: 0 additions & 1 deletion antigate/backends/requests_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

class Http(object):
def __init__(self, **config):
print("> Requests")
self.r = None
self.conf = {}
self.config = config
Expand Down
1 change: 0 additions & 1 deletion antigate/backends/urllib_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class Http(object):
def __init__(self, **config):
print("> UrlLib")
self.u = None
self.r = None
self.conf = {}
Expand Down
1 change: 1 addition & 0 deletions requirements/readthedocs.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Django>=1.8,<1.9
Sphinx==1.3.3
5 changes: 5 additions & 0 deletions test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def test_load(self):
def test_base(self):
self.assertEqual(str(AntiGate(API_KEY, IMAGE1)), '123')

def test_captcha_config(self):
config = {'min_len': '3', 'max_len': '4', 'numeric': '1'}
ag = AntiGate(API_KEY, IMAGE1, send_config=config)
self.assertEqual(str(ag), '123')

def test_base_binary(self):
fp = open(IMAGE1, 'rb')
self.assertEqual(str(AntiGate(API_KEY, fp.read())), '123')
Expand Down
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
envlist =
pep8,

py27,
py34,
py35,
coverage,

Expand All @@ -13,13 +13,15 @@ deps =
-r{toxinidir}/requirements/package.txt

commands =
python test_cases.py
env ANTIGATE_HTTP_BACKEND=antigate.backends.requests_lib make test
env ANTIGATE_HTTP_BACKEND=antigate.backends.urllib_lib make test
env ANTIGATE_HTTP_BACKEND=antigate.backends.grab_lib make test

[testenv:pep8]
deps =
flake8==2.4.1
commands =
flake8 antigate
flake8 antigate --ignore F811

[testenv:coverage]
deps =
Expand Down

0 comments on commit 3eeb0d5

Please sign in to comment.