Skip to content

Commit 40fb843

Browse files
flake8 fixes
1 parent f3bdb70 commit 40fb843

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

connect/resource/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ def get(self, pk):
134134

135135
@staticmethod
136136
def urljoin(*args):
137-
return functools.reduce(lambda a, b: compat.urljoin(a + ('' if a.endswith('/') else '/'), b), args)
137+
return functools.reduce(
138+
lambda a, b: compat.urljoin(a + ('' if a.endswith('/') else '/'), b),
139+
args)
138140

139141
def _load_schema(self, response, many=None):
140142
# type: (str, bool) -> Union[List[Any], Any]

connect/resource/usage_automation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ def submit_usage(self, usage_file, usage_records):
148148
def _get_usage_template_download_location(self, product_id):
149149
# type: (str) -> str
150150
try:
151-
response = self.api.get(self.urljoin(self.config.api_url, '/usage/products/' + product_id + ''))
151+
response = self.api.get(self.urljoin(self.config.api_url,
152+
'/usage/products/' + product_id + ''))
152153
response_dict = json.loads(response)
153154
return response_dict['template_link']
154155
except (requests.exceptions.RequestException, KeyError, TypeError, ValueError):

tests/test_usage.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ def test_process():
4747
resource.process()
4848

4949

50-
@patch('requests.get', MagicMock(
51-
return_value=Response(ok=True, content='{"template_link": "..."}', text='test', status_code=200)))
50+
@patch('requests.get', MagicMock(return_value=Response(
51+
ok=True, content='{"template_link": "..."}', text='test', status_code=200)))
5252
def test_get_usage_template_ok():
5353
assert UsageAutomation().get_usage_template(Product(id='PRD-638-321-603')) == 'test'
5454

5555

56-
@patch('requests.get', MagicMock(return_value=Response(ok=True, content='{}', text='', status_code=200)))
56+
@patch('requests.get', MagicMock(return_value=Response(
57+
ok=True, content='{}', text='', status_code=200)))
5758
def test_get_usage_template_no_link():
5859
with pytest.raises(FileRetrievalError):
5960
UsageAutomation().get_usage_template(Product(id='PRD-638-321-603'))

0 commit comments

Comments
 (0)