diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e382de7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: python +python: + - "2.7" + - "3.3" + - "3.4" + - "3.5" + - "3.5-dev" # 3.5 development branch + - "nightly" # currently points to 3.6-dev +script: + - "python setup.py test" + - coverage run --source=awis setup.py test +after_success: + - coveralls diff --git a/README.rst b/README.rst index ee98349..c446712 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,4 @@ +[![Build Status](https://travis-ci.org/muhuk/python-awis.svg?branch=master)](https://travis-ci.org/muhuk/python-awis) Wraps `Alexa Web Information Service`_. Usage diff --git a/awis/__init__.py b/awis/__init__.py index 687e3ba..bfd34b0 100644 --- a/awis/__init__.py +++ b/awis/__init__.py @@ -121,7 +121,7 @@ def category_listings(self, path, SortBy="Popularity", Recursive=False, Start=1, params = { "Action": "CategoryListings", "ResponseGroup": "Listings", - "Path": quote(path), + "Path": path, "SortBy": SortBy, "Start": str(Start), "Recursive": str(not not Recursive), diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1012bfe --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pytest==2.8.5 +coverage==4.0.3 +coveralls==1.1 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..b7e4789 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[aliases] +test=pytest diff --git a/setup.py b/setup.py index 059eb0d..d40747d 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from distutils.core import setup +from setuptools import setup from distutils.command.install import INSTALL_SCHEMES from awis import __version__, __maintainer__, __email__ @@ -14,6 +14,8 @@ setup( + setup_requires=['pytest-runner'], + tests_require=['pytest'], name = 'python-awis', version = __version__, url = 'http://github.com/muhuk/python-awis', diff --git a/test/conftest.py b/test/conftest.py new file mode 100644 index 0000000..ee6a555 --- /dev/null +++ b/test/conftest.py @@ -0,0 +1,3 @@ +import sys, os +sys.path.append(os.path.abspath('.')) + diff --git a/test/test_awis.py b/test/test_awis.py new file mode 100755 index 0000000..8c09e2c --- /dev/null +++ b/test/test_awis.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from awis import AwisApi +import os + +def test_unicode(): + api = AwisApi(os.environ['AWS_ACCESS_ID'], os.environ['AWS_SECRET_ACCESS_KEY']) + tree = api.category_listings("Top/World/Dansk/Børn_og_unge/Kultur") + listings = tree.findall('.//awis:Listing', AwisApi.NS_PREFIXES) + + assert len(listings) > 0