Skip to content

Commit 060827a

Browse files
committed
fix lint
1 parent c87f8d9 commit 060827a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

dynatademand/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ def update_template(self, id, template):
498498

499499
def delete_template(self, id):
500500
self.validator.validate_request(
501-
'delete_template',
502-
path_data={'id': '{}'.format(id)},
501+
'delete_template',
502+
path_data={'id': '{}'.format(id)},
503503
)
504504
return self._api_delete('/templates/quotaplan/{}'.format(id))
505505

@@ -512,4 +512,4 @@ def get_templates(self, country, lang, **kwargs):
512512
},
513513
query_params=kwargs,
514514
)
515-
return self._api_get('/templates/quotaplan/{}/{}'.format(country, lang), kwargs)
515+
return self._api_get('/templates/quotaplan/{}/{}'.format(country, lang), kwargs)

tests/test_template.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
BASE_HOST = "http://test-url.example"
1111

12+
1213
class TestTemplateEndpoints(unittest.TestCase):
1314
def setUp(self):
1415
self.api = DemandAPIClient(client_id='test', username='testuser', password='testpass', base_host=BASE_HOST)
@@ -19,7 +20,10 @@ def test_get_templates(self):
1920
# Tests getting all templates.
2021
with open('./tests/test_files/get_templates.json', 'r') as options:
2122
options_json = json.load(options)
22-
responses.add(responses.GET, '{}/sample/v1/templates/quotaplan/{}/{}'.format(BASE_HOST, 'US', 'en'),
23+
# Success response
24+
responses.add(
25+
responses.GET,
26+
'{}/sample/v1/templates/quotaplan/{}/{}'.format(BASE_HOST,'US','en'),
2327
json=options_json,
2428
status=200)
2529
self.api.get_templates('US', 'en')
@@ -74,15 +78,13 @@ def test_delete_template(self):
7478
responses.DELETE,
7579
'{}/sample/v1/templates/quotaplan/1'.format(BASE_HOST),
7680
json={'status': {'message': 'success'}},
77-
status=200
78-
)
81+
status=200)
7982
# Response with error status
8083
responses.add(
8184
responses.DELETE,
8285
'{}/sample/v1/templates/quotaplan/1'.format(BASE_HOST),
8386
json={'status': {'message': 'error'}},
84-
status=200
85-
)
87+
status=200)
8688
# Test successful response
8789
self.api.delete_template(1)
88-
self.assertEqual(len(responses.calls), 1)
90+
self.assertEqual(len(responses.calls), 1)

0 commit comments

Comments
 (0)