Skip to content

Commit e77c263

Browse files
authored
Merge pull request #2946 from daspecster/update-import-spacing-2
Update import spacing part 2.
2 parents e094c4b + b434e42 commit e77c263

File tree

13 files changed

+184
-1
lines changed

13 files changed

+184
-1
lines changed

packages/google-cloud-core/unit_tests/streaming/test_buffered_stream.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Test_BufferedStream(unittest.TestCase):
2020
@staticmethod
2121
def _get_target_class():
2222
from google.cloud.streaming.buffered_stream import BufferedStream
23+
2324
return BufferedStream
2425

2526
def _make_one(self, *args, **kw):
@@ -41,6 +42,7 @@ class _Stream(object):
4142

4243
def test_ctor_start_zero_longer_than_buffer(self):
4344
from io import BytesIO
45+
4446
CONTENT = b'CONTENT GOES HERE'
4547
START = 0
4648
BUFSIZE = 4
@@ -56,6 +58,7 @@ def test_ctor_start_zero_longer_than_buffer(self):
5658

5759
def test_ctor_start_nonzero_shorter_than_buffer(self):
5860
from io import BytesIO
61+
5962
CONTENT = b'CONTENT GOES HERE'
6063
START = 8
6164
BUFSIZE = 10
@@ -72,6 +75,7 @@ def test_ctor_start_nonzero_shorter_than_buffer(self):
7275

7376
def test__bytes_remaining_start_zero_longer_than_buffer(self):
7477
from io import BytesIO
78+
7579
CONTENT = b'CONTENT GOES HERE'
7680
START = 0
7781
BUFSIZE = 4
@@ -81,6 +85,7 @@ def test__bytes_remaining_start_zero_longer_than_buffer(self):
8185

8286
def test__bytes_remaining_start_zero_shorter_than_buffer(self):
8387
from io import BytesIO
88+
8489
CONTENT = b'CONTENT GOES HERE'
8590
START = 8
8691
BUFSIZE = 10
@@ -91,6 +96,7 @@ def test__bytes_remaining_start_zero_shorter_than_buffer(self):
9196

9297
def test_read_w_none(self):
9398
from io import BytesIO
99+
94100
CONTENT = b'CONTENT GOES HERE'
95101
START = 0
96102
BUFSIZE = 4
@@ -101,6 +107,7 @@ def test_read_w_none(self):
101107

102108
def test_read_w_negative_size(self):
103109
from io import BytesIO
110+
104111
CONTENT = b'CONTENT GOES HERE'
105112
START = 0
106113
BUFSIZE = 4
@@ -111,6 +118,7 @@ def test_read_w_negative_size(self):
111118

112119
def test_read_from_start(self):
113120
from io import BytesIO
121+
114122
CONTENT = b'CONTENT GOES HERE'
115123
START = 0
116124
BUFSIZE = 4
@@ -120,6 +128,7 @@ def test_read_from_start(self):
120128

121129
def test_read_exhausted(self):
122130
from io import BytesIO
131+
123132
CONTENT = b'CONTENT GOES HERE'
124133
START = len(CONTENT)
125134
BUFSIZE = 10

packages/google-cloud-core/unit_tests/streaming/test_exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Test_HttpError(unittest.TestCase):
2020
@staticmethod
2121
def _get_target_class():
2222
from google.cloud.streaming.exceptions import HttpError
23+
2324
return HttpError
2425

2526
def _make_one(self, *args, **kw):
@@ -62,6 +63,7 @@ class Test_RetryAfterError(unittest.TestCase):
6263
@staticmethod
6364
def _get_target_class():
6465
from google.cloud.streaming.exceptions import RetryAfterError
66+
6567
return RetryAfterError
6668

6769
def _make_one(self, *args, **kw):

packages/google-cloud-core/unit_tests/streaming/test_http_wrapper.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Test__httplib2_debug_level(unittest.TestCase):
2020
@staticmethod
2121
def _get_target_class():
2222
from google.cloud.streaming.http_wrapper import _httplib2_debug_level
23+
2324
return _httplib2_debug_level
2425

2526
def _make_one(self, *args, **kw):
@@ -80,6 +81,7 @@ class Test_Request(unittest.TestCase):
8081
@staticmethod
8182
def _get_target_class():
8283
from google.cloud.streaming.http_wrapper import Request
84+
8385
return Request
8486

8587
def _make_one(self, *args, **kw):
@@ -95,6 +97,7 @@ def test_ctor_defaults(self):
9597

9698
def test_loggable_body_setter_w_body_None(self):
9799
from google.cloud.streaming.exceptions import RequestError
100+
98101
request = self._make_one(body=None)
99102
with self.assertRaises(RequestError):
100103
request.loggable_body = 'abc'
@@ -121,6 +124,7 @@ class Test_Response(unittest.TestCase):
121124
@staticmethod
122125
def _get_target_class():
123126
from google.cloud.streaming.http_wrapper import Response
127+
124128
return Response
125129

126130
def _make_one(self, *args, **kw):
@@ -217,10 +221,12 @@ class Test__check_response(unittest.TestCase):
217221

218222
def _call_fut(self, *args, **kw):
219223
from google.cloud.streaming.http_wrapper import _check_response
224+
220225
return _check_response(*args, **kw)
221226

222227
def test_w_none(self):
223228
from google.cloud.streaming.exceptions import RequestError
229+
224230
with self.assertRaises(RequestError):
225231
self._call_fut(None)
226232

@@ -254,6 +260,7 @@ class Test__reset_http_connections(unittest.TestCase):
254260

255261
def _call_fut(self, *args, **kw):
256262
from google.cloud.streaming.http_wrapper import _reset_http_connections
263+
257264
return _reset_http_connections(*args, **kw)
258265

259266
def test_wo_connections(self):
@@ -289,6 +296,7 @@ def _verify_requested(self, http, request,
289296
def test_defaults_wo_connections(self):
290297
from google.cloud._testing import _Monkey
291298
from google.cloud.streaming import http_wrapper as MUT
299+
292300
INFO = {'status': '200'}
293301
CONTENT = 'CONTENT'
294302
_http = _Http((INFO, CONTENT))
@@ -309,6 +317,7 @@ def test_defaults_wo_connections(self):
309317
def test_w_http_connections_miss(self):
310318
from google.cloud._testing import _Monkey
311319
from google.cloud.streaming import http_wrapper as MUT
320+
312321
INFO = {'status': '200'}
313322
CONTENT = 'CONTENT'
314323
CONN_TYPE = object()
@@ -331,6 +340,7 @@ def test_w_http_connections_miss(self):
331340
def test_w_http_connections_hit(self):
332341
from google.cloud._testing import _Monkey
333342
from google.cloud.streaming import http_wrapper as MUT
343+
334344
INFO = {'status': '200'}
335345
CONTENT = 'CONTENT'
336346
CONN_TYPE = object()
@@ -354,6 +364,7 @@ def test_w_request_returning_None(self):
354364
from google.cloud._testing import _Monkey
355365
from google.cloud.streaming import http_wrapper as MUT
356366
from google.cloud.streaming.exceptions import RequestError
367+
357368
INFO = None
358369
CONTENT = None
359370
CONN_TYPE = object()
@@ -371,6 +382,7 @@ class Test_make_api_request(unittest.TestCase):
371382

372383
def _call_fut(self, *args, **kw):
373384
from google.cloud.streaming.http_wrapper import make_api_request
385+
374386
return make_api_request(*args, **kw)
375387

376388
def test_wo_exception(self):
@@ -424,6 +436,7 @@ def _wo_exception(*args, **kw):
424436
def test_w_exceptions_gt_max_retries(self):
425437
from google.cloud._testing import _Monkey
426438
from google.cloud.streaming import http_wrapper as MUT
439+
427440
HTTP = object()
428441
REQUEST = _Request()
429442
_created, _checked = [], []

packages/google-cloud-core/unit_tests/streaming/test_stream_slice.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ class Test_StreamSlice(unittest.TestCase):
2020
@staticmethod
2121
def _get_target_class():
2222
from google.cloud.streaming.stream_slice import StreamSlice
23+
2324
return StreamSlice
2425

2526
def _make_one(self, *args, **kw):
2627
return self._get_target_class()(*args, **kw)
2728

2829
def test_ctor(self):
2930
from io import BytesIO
31+
3032
CONTENT = b'CONTENT GOES HERE'
3133
MAXSIZE = 4
3234
stream = BytesIO(CONTENT)
@@ -39,6 +41,7 @@ def test_ctor(self):
3941

4042
def test___nonzero___empty(self):
4143
from io import BytesIO
44+
4245
CONTENT = b''
4346
MAXSIZE = 0
4447
stream = BytesIO(CONTENT)
@@ -47,6 +50,7 @@ def test___nonzero___empty(self):
4750

4851
def test___nonzero___nonempty(self):
4952
from io import BytesIO
53+
5054
CONTENT = b'CONTENT GOES HERE'
5155
MAXSIZE = 4
5256
stream = BytesIO(CONTENT)
@@ -56,6 +60,7 @@ def test___nonzero___nonempty(self):
5660
def test_read_exhausted(self):
5761
from io import BytesIO
5862
from six.moves import http_client
63+
5964
CONTENT = b''
6065
MAXSIZE = 4
6166
stream = BytesIO(CONTENT)
@@ -65,6 +70,7 @@ def test_read_exhausted(self):
6570

6671
def test_read_implicit_size(self):
6772
from io import BytesIO
73+
6874
CONTENT = b'CONTENT GOES HERE'
6975
MAXSIZE = 4
7076
stream = BytesIO(CONTENT)
@@ -74,6 +80,7 @@ def test_read_implicit_size(self):
7480

7581
def test_read_explicit_size(self):
7682
from io import BytesIO
83+
7784
CONTENT = b'CONTENT GOES HERE'
7885
MAXSIZE = 4
7986
SIZE = 3

0 commit comments

Comments
 (0)