summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Saryerwinnie <js@jamesls.com>2015-12-22 16:01:44 -0800
committerJames Saryerwinnie <js@jamesls.com>2015-12-22 16:01:44 -0800
commit5b2f552d30921b1ac220a48472cbb5a6dea8da3d (patch)
treec6f0c5f87aff7d2786be30c329de67d504de3daa
parent7d039d0dab90142087c79343ebffc5aadd95138a (diff)
parentff5f116479f7c7fe42eb748fa62f1fcf1205cb22 (diff)
downloadboto-5b2f552d30921b1ac220a48472cbb5a6dea8da3d.tar.gz
Merge branch 'py3-unit-tests' into develop
Closes #3441 * py3-unit-tests: Remove py3 test whitelist Update rds to pass on py3 Update mturk to pass tests on py3 Update cloudsearchdomain tests to work with py3
-rw-r--r--boto/auth.py4
-rw-r--r--boto/mturk/connection.py2
-rw-r--r--boto/rds/__init__.py2
-rwxr-xr-xtests/test.py53
-rw-r--r--tests/unit/cloudsearchdomain/test_cloudsearchdomain.py6
5 files changed, 10 insertions, 57 deletions
diff --git a/boto/auth.py b/boto/auth.py
index 636dcfdd..f31658f8 100644
--- a/boto/auth.py
+++ b/boto/auth.py
@@ -878,8 +878,8 @@ class QuerySignatureV1AuthHandler(QuerySignatureHelper, AuthHandler):
def _calc_signature(self, params, *args):
boto.log.debug('using _calc_signature_1')
hmac = self._get_hmac()
- keys = params.keys()
- keys.sort(cmp=lambda x, y: cmp(x.lower(), y.lower()))
+ keys = list(params.keys())
+ keys.sort(key=lambda x: x.lower())
pairs = []
for key in keys:
hmac.update(key.encode('utf-8'))
diff --git a/boto/mturk/connection.py b/boto/mturk/connection.py
index 4f2a23fa..506746cf 100644
--- a/boto/mturk/connection.py
+++ b/boto/mturk/connection.py
@@ -844,7 +844,7 @@ class MTurkConnection(AWSQueryConnection):
body = response.read()
if self.debug == 2:
print(body)
- if '<Errors>' not in body:
+ if '<Errors>' not in body.decode('utf-8'):
rs = ResultSet(marker_elems)
h = handler.XmlHandler(rs, self)
xml.sax.parseString(body, h)
diff --git a/boto/rds/__init__.py b/boto/rds/__init__.py
index 8e8afa81..15c838b8 100644
--- a/boto/rds/__init__.py
+++ b/boto/rds/__init__.py
@@ -451,7 +451,7 @@ class RDSConnection(AWSQueryConnection):
self.build_list_params(params, l, 'VpcSecurityGroupIds.member')
# Remove any params set to None
- for k, v in params.items():
+ for k, v in list(params.items()):
if v is None: del(params[k])
return self.get_object('CreateDBInstance', params, DBInstance)
diff --git a/tests/test.py b/tests/test.py
index c20f35d7..9f5c6334 100755
--- a/tests/test.py
+++ b/tests/test.py
@@ -28,52 +28,7 @@ import sys
from nose.core import run
-# This is a whitelist of unit tests that support Python 3.
-# When porting a new module to Python 3, please update this
-# list so that its tests will run by default. See the
-# `default` target below for more information.
-# We use this instead of test attributes/tags because in
-# order to filter on tags nose must load each test - many
-# will fail to import with Python 3.
-PY3_WHITELIST = (
- 'tests/unit/auth',
- 'tests/unit/beanstalk',
- 'tests/unit/cloudformation',
- 'tests/unit/cloudfront',
- 'tests/unit/cloudsearch',
- 'tests/unit/cloudsearch2',
- 'tests/unit/cloudtrail',
- 'tests/unit/directconnect',
- 'tests/unit/dynamodb',
- 'tests/unit/dynamodb2',
- 'tests/unit/ecs',
- 'tests/unit/elasticache',
- 'tests/unit/emr',
- 'tests/unit/glacier',
- 'tests/unit/iam',
- 'tests/unit/ec2',
- 'tests/unit/kms',
- 'tests/unit/logs',
- 'tests/unit/manage',
- 'tests/unit/mws',
- 'tests/unit/provider',
- 'tests/unit/rds2',
- 'tests/unit/route53',
- 'tests/unit/s3',
- 'tests/unit/sns',
- 'tests/unit/ses',
- 'tests/unit/sqs',
- 'tests/unit/sts',
- 'tests/unit/swf',
- 'tests/unit/utils',
- 'tests/unit/vpc',
- 'tests/unit/test_connection.py',
- 'tests/unit/test_exception.py',
- 'tests/unit/test_regioninfo.py',
-)
-
-
-def main(whitelist=[]):
+def main():
description = ("Runs boto unit and/or integration tests. "
"Arguments will be passed on to nosetests. "
"See nosetests --help for more information.")
@@ -99,11 +54,7 @@ def main(whitelist=[]):
for i, arg in enumerate(remaining_args):
if arg == 'default':
- if sys.version_info[0] == 3:
- del remaining_args[i]
- remaining_args += PY3_WHITELIST
- else:
- remaining_args[i] = 'tests/unit'
+ remaining_args[i] = 'tests/unit'
all_args = [__file__] + attribute_args + remaining_args
print("nose command:", ' '.join(all_args))
diff --git a/tests/unit/cloudsearchdomain/test_cloudsearchdomain.py b/tests/unit/cloudsearchdomain/test_cloudsearchdomain.py
index 694e98ff..e0758a47 100644
--- a/tests/unit/cloudsearchdomain/test_cloudsearchdomain.py
+++ b/tests/unit/cloudsearchdomain/test_cloudsearchdomain.py
@@ -82,7 +82,8 @@ class CloudSearchDomainConnectionTest(AWSMockServiceTestCase):
}
- self.set_http_response(status_code=200, body=json.dumps(response))
+ self.set_http_response(status_code=200,
+ body=json.dumps(response).encode('utf-8'))
search_service.domain_connection = self.service_connection
resp = search_service.search()
@@ -109,7 +110,8 @@ class CloudSearchDomainConnectionTest(AWSMockServiceTestCase):
"category": ["cat_a", "cat_b", "cat_c"]
}
- self.set_http_response(status_code=200, body=json.dumps(response))
+ self.set_http_response(status_code=200,
+ body=json.dumps(response).encode('utf-8'))
document_service.domain_connection = self.service_connection
document_service.add("1234", document)
resp = document_service.commit()