Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred82santa committed Apr 28, 2016
1 parent 105df2b commit 0e61be1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 17 deletions.
4 changes: 2 additions & 2 deletions service_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def call(self, service_name, payload=None, **kwargs):
yield from self.prepare_request_params(service_desc, session, request_params)

self.logger.info("Calling service_client {0} using {1} {2}".format(service_name,
request_params['method'],
request_params['url']))
request_params['method'],
request_params['url']))

payload = yield from self.prepare_payload(service_desc, session, request_params, payload)
try:
Expand Down
2 changes: 0 additions & 2 deletions service_client/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,3 @@ def prepare_session(self, service_desc, session, request_params):
session.request.set_request_params(request_params)
except AttributeError:
pass


1 change: 0 additions & 1 deletion tests/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ def __call__(self, *args, **kwargs):
response.status = 200

return response

3 changes: 1 addition & 2 deletions tests/tests_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_parse(self):
def test_parse_none(self):
self.assertIsNone(self.parser(None))


class TestJsonSerializer(TestCase):

def setUp(self):
Expand All @@ -25,5 +26,3 @@ def test_serialize_data(self):

self.assertEqual('{"pepito": "grillo"}',
self.serializer({"pepito": "grillo"}))


11 changes: 3 additions & 8 deletions tests/tests_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
from asyncio import coroutine
from aiohttp.client import ClientSession
from asynctest.case import TestCase

from aiohttp.client_reqrep import ClientResponse

from service_client.plugins import Path, Timeout, Headers, QueryParams, Mock


Expand Down Expand Up @@ -244,9 +241,9 @@ def setUp(self):
self.plugin = Mock(namespaces={'mocks': 'tests.mocks'})
self.session = ClientSession()
self.service_desc = {'mock': {
'mock_type': 'mocks:FakeMock',
'file': 'data/mocks/opengate_v6/alarm/alarm_list.json'
}}
'mock_type': 'mocks:FakeMock',
'file': 'data/mocks/opengate_v6/alarm/alarm_list.json'
}}

self.service_client = type('DynTestServiceClient', (),
{'rest_service_name': 'test_service_name',
Expand All @@ -260,5 +257,3 @@ def test_calling_mock(self):
self.assertIsInstance(self.session.request, FakeMock)
response = self.session.request('POST', 'default_url')
self.assertEqual(200, response.status)


2 changes: 1 addition & 1 deletion tests/tests_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,4 @@ def serializer(data, *args, **kwargs):

self.service.serializer = serializer

response = yield from self.service.call('testService5', payload='aaaa')
yield from self.service.call('testService5', payload='aaaa')
2 changes: 1 addition & 1 deletion tests/tests_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ def test_no_items_not_indexed_args(self):
"Test {0} with {1} indexed args")

self.assertEqual(self.formatter.get_substituted_fields(), [])
self.assertEqual(self.formatter.get_not_substituted_fields(), ['0', '1'])
self.assertEqual(self.formatter.get_not_substituted_fields(), ['0', '1'])

0 comments on commit 0e61be1

Please sign in to comment.