From 3157a380af8775309bcd50c0f6eb6b97e7d8fd84 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Fri, 25 Jul 2014 10:53:17 +0800 Subject: logs module: enable unit tests in python 3 --- boto/logs/layer1.py | 7 +------ tests/test.py | 1 + tests/unit/logs/test_layer1.py | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/boto/logs/layer1.py b/boto/logs/layer1.py index 52d7791e..254e2855 100644 --- a/boto/logs/layer1.py +++ b/boto/logs/layer1.py @@ -20,16 +20,12 @@ # IN THE SOFTWARE. # -try: - import json -except ImportError: - import simplejson as json - import boto from boto.connection import AWSQueryConnection from boto.regioninfo import RegionInfo from boto.exception import JSONResponseError from boto.logs import exceptions +from boto.compat import json class CloudWatchLogsConnection(AWSQueryConnection): @@ -579,4 +575,3 @@ class CloudWatchLogsConnection(AWSQueryConnection): exception_class = self._faults.get(fault_name, self.ResponseError) raise exception_class(response.status, response.reason, body=json_body) - diff --git a/tests/test.py b/tests/test.py index 3fa2fb87..8c447e79 100755 --- a/tests/test.py +++ b/tests/test.py @@ -50,6 +50,7 @@ PY3_WHITELIST = ( 'tests/unit/glacier', 'tests/unit/iam', 'tests/unit/ec2', + 'tests/unit/logs', 'tests/unit/manage', 'tests/unit/mws', 'tests/unit/provider', diff --git a/tests/unit/logs/test_layer1.py b/tests/unit/logs/test_layer1.py index 9b8dc2ef..7aae5b09 100644 --- a/tests/unit/logs/test_layer1.py +++ b/tests/unit/logs/test_layer1.py @@ -13,7 +13,7 @@ class TestDescribeLogs(AWSMockServiceTestCase): def test_describe(self): self.set_http_response(status_code=200) api_response = self.service_connection.describe_log_groups() - + self.assertEqual(0, len(api_response['logGroups'])) self.assert_request_parameters({}) -- cgit v1.2.1