Skip to content

Commit c21fd7b

Browse files
committed
String Formatting and PEP-8 fixes
1 parent 9196b9f commit c21fd7b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ print response.body
7878
import python_http_client
7979
global_headers = {"Authorization": "Basic XXXXXXX"}
8080
client = Client(host='base_url', request_headers=global_headers)
81-
query_params={"hello":0, "world":1}
81+
query_params={"hello": 0, "world": 1}
8282
request_headers={"X-Test": "test"}
8383
data={"some": 1, "awesome": 2, "data": 3}
8484
response = client.your.api._(param).call.post(request_body=data,

python_http_client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def _build_url(self, query_params):
128128
if self._version:
129129
url = self._build_versioned_url(url)
130130
else:
131-
url = self.host + url
131+
url = '{}{}'.format(self.host, url)
132132
return url
133133

134134
def _update_headers(self, request_headers):
@@ -147,7 +147,7 @@ def _build_client(self, name=None):
147147
:type name: string
148148
:return: A Client object
149149
"""
150-
url_path = self._url_path + [name] if name else self._url_path
150+
url_path = '{}{}'.format(self._url_path, [name]) if name else self._url_path
151151
return Client(host=self.host,
152152
version=self._version,
153153
request_headers=self.request_headers,

tests/test_repofiles.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ def _all_file(self, files):
3131
def test_file_existence(self):
3232
missing = list(filter(self._all_file, self.FILES))
3333
self.assertEqual(len(missing), 0,
34-
"Files %s aren't found" % str(missing))
34+
"Files {} aren't found".format(missing)
35+
)

tests/test_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def setUp(self):
7070
self.api_key = "SENDGRID_API_KEY"
7171
self.request_headers = {
7272
'Content-Type': 'application/json',
73-
'Authorization': 'Bearer ' + self.api_key
73+
'Authorization': 'Bearer {}'.format(self.api_key)
7474
}
7575
self.client = Client(host=self.host,
7676
request_headers=self.request_headers,

0 commit comments

Comments
 (0)