From 8d59409074fab4529b9458a76a5a16ebec153b75 Mon Sep 17 00:00:00 2001 From: Allen Luce Date: Wed, 27 Jan 2016 10:57:00 -0800 Subject: [PATCH] Remove test and unused module Add a little paranoia to the recursive check. --- awis/__init__.py | 3 +-- test_awis.py | 19 ------------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 test_awis.py diff --git a/awis/__init__.py b/awis/__init__.py index b44056f..687e3ba 100644 --- a/awis/__init__.py +++ b/awis/__init__.py @@ -21,7 +21,6 @@ import datetime import hashlib import hmac -import sys try: from urllib.request import urlopen @@ -125,7 +124,7 @@ def category_listings(self, path, SortBy="Popularity", Recursive=False, Start=1, "Path": quote(path), "SortBy": SortBy, "Start": str(Start), - "Recursive": str(Recursive), + "Recursive": str(not not Recursive), "Descriptions": str(Descriptions) } if Count < 100: diff --git a/test_awis.py b/test_awis.py deleted file mode 100644 index a1cd577..0000000 --- a/test_awis.py +++ /dev/null @@ -1,19 +0,0 @@ -import os -from awis import AwisApi - -ACCESS_ID = os.getenv('ACCESS_ID') -SECRET_ACCESS_KEY = os.getenv('SECRET_ACCESS_KEY') -assert ACCESS_ID is not None and SECRET_ACCESS_KEY is not None, \ - 'Tests require ACCESS_ID and SECRET_ACCESS_KEY to be set in the environment' - -def test_category_listings(): - api = AwisApi(ACCESS_ID, SECRET_ACCESS_KEY) - tree = api.category_listings("Top/Business/Financial_Services") - items = tree.findall(".//{%s}Count" % api.NS_PREFIXES["awis"]) - assert items[0].text > 0 - -def test_url_info(): - api = AwisApi(ACCESS_ID, SECRET_ACCESS_KEY) - tree = api.url_info("www.domain.com", "Rank", "LinksInCount") - elem = tree.find(".//{%s}StatusCode" % api.NS_PREFIXES["alexa"]) - assert elem.text == "Success"