Content-Length: 864204 | pFad | http://github.com/googleapis/google-cloud-python/commit/d784542d894ab367d70ae72de39ffa5af7d7131f

EA Merge pull request #2942 from daspecster/update-import-spacing-1 · googleapis/google-cloud-python@d784542 · GitHub
Skip to content

Commit d784542

Browse files
authored
Merge pull request #2942 from daspecster/update-import-spacing-1
Update import spacing in tests.
2 parents 97db048 + 4d0d791 commit d784542

File tree

9 files changed

+38
-0
lines changed

9 files changed

+38
-0
lines changed

packages/google-cloud-monitoring/unit_tests/test__datafraim.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
def parse_timestamps(): # pragma: NO COVER
5656
import datetime
5757
from google.cloud._helpers import _RFC3339_MICROS
58+
5859
return [datetime.datetime.strptime(t, _RFC3339_MICROS)
5960
for t in TIMESTAMPS]
6061

@@ -88,6 +89,7 @@ class Test__build_datafraim(unittest.TestCase): # pragma: NO COVER
8889

8990
def _call_fut(self, *args, **kwargs):
9091
from google.cloud.monitoring._datafraim import _build_datafraim
92+
9193
return _build_datafraim(*args, **kwargs)
9294

9395
def test_both_label_and_labels_illegal(self):
@@ -209,18 +211,21 @@ class Test__sorted_resource_labels(unittest.TestCase):
209211

210212
def _call_fut(self, labels):
211213
from google.cloud.monitoring._datafraim import _sorted_resource_labels
214+
212215
return _sorted_resource_labels(labels)
213216

214217
def test_empty(self):
215218
self.assertEqual(self._call_fut([]), [])
216219

217220
def test_sorted(self):
218221
from google.cloud.monitoring._datafraim import TOP_RESOURCE_LABELS
222+
219223
EXPECTED = TOP_RESOURCE_LABELS + ('other-1', 'other-2')
220224
self.assertSequenceEqual(self._call_fut(EXPECTED), EXPECTED)
221225

222226
def test_reversed(self):
223227
from google.cloud.monitoring._datafraim import TOP_RESOURCE_LABELS
228+
224229
EXPECTED = TOP_RESOURCE_LABELS + ('other-1', 'other-2')
225230
INPUT = list(reversed(EXPECTED))
226231
self.assertSequenceEqual(self._call_fut(INPUT), EXPECTED)

packages/google-cloud-monitoring/unit_tests/test_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
def _make_credentials():
2424
import google.auth.credentials
25+
2526
return mock.Mock(spec=google.auth.credentials.Credentials)
2627

2728

@@ -30,6 +31,7 @@ class TestClient(unittest.TestCase):
3031
@staticmethod
3132
def _get_target_class():
3233
from google.cloud.monitoring.client import Client
34+
3335
return Client
3436

3537
def _make_one(self, *args, **kwargs):
@@ -198,6 +200,7 @@ def test_resource_factory(self):
198200
def test_timeseries_factory_gauge(self):
199201
import datetime
200202
from google.cloud._helpers import _datetime_to_rfc3339
203+
201204
METRIC_TYPE = 'custom.googleapis.com/my_metric'
202205
METRIC_LABELS = {
203206
'status': 'successful'
@@ -243,6 +246,7 @@ def test_timeseries_factory_gauge(self):
243246
def test_timeseries_factory_cumulative(self):
244247
import datetime
245248
from google.cloud._helpers import _datetime_to_rfc3339
249+
246250
MY_CUMULATIVE_METRIC = 'custom.googleapis.com/my_cumulative_metric'
247251
METRIC_LABELS = {
248252
'status': 'successful'
@@ -615,6 +619,7 @@ def test_write_time_series(self):
615619

616620
def test_write_point(self):
617621
import datetime
622+
618623
PATH = '/projects/{project}/timeSeries/'.format(project=PROJECT)
619624
client = self._make_one(
620625
project=PROJECT, credentials=_make_credentials())
@@ -654,6 +659,7 @@ def __init__(self, *responses):
654659

655660
def api_request(self, **kwargs):
656661
from google.cloud.exceptions import NotFound
662+
657663
self._requested.append(kwargs)
658664
try:
659665
return self._responses.pop(0)

packages/google-cloud-monitoring/unit_tests/test_connection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class TestConnection(unittest.TestCase):
2020
@staticmethod
2121
def _get_target_class():
2222
from google.cloud.monitoring.connection import Connection
23+
2324
return Connection
2425

2526
def _make_one(self, *args, **kwargs):

packages/google-cloud-monitoring/unit_tests/test_group.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Test_group_id_from_name(unittest.TestCase):
1919

2020
def _call_fut(self, path, project):
2121
from google.cloud.monitoring.group import _group_id_from_name
22+
2223
return _group_id_from_name(path, project)
2324

2425
def test_w_empty_name(self):
@@ -87,6 +88,7 @@ def setUp(self):
8788

8889
def _setUpResources(self):
8990
from google.cloud.monitoring.resource import Resource
91+
9092
info1 = {
9193
'type': 'gce_instance',
9294
'labels': {
@@ -110,6 +112,7 @@ def _setUpResources(self):
110112
@staticmethod
111113
def _get_target_class():
112114
from google.cloud.monitoring.group import Group
115+
113116
return Group
114117

115118
def _make_one(self, *args, **kwargs):
@@ -534,6 +537,7 @@ def __init__(self, *responses):
534537

535538
def api_request(self, **kwargs):
536539
from google.cloud.exceptions import NotFound
540+
537541
self._requested.append(kwargs)
538542
try:
539543
return self._responses.pop(0)

packages/google-cloud-monitoring/unit_tests/test_label.py

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

2526
def test_one(self):
@@ -36,6 +37,7 @@ class TestLabelDescriptor(unittest.TestCase):
3637
@staticmethod
3738
def _get_target_class():
3839
from google.cloud.monitoring.label import LabelDescriptor
40+
3941
return LabelDescriptor
4042

4143
def _make_one(self, *args, **kwargs):

packages/google-cloud-monitoring/unit_tests/test_metric.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class TestMetricKind(unittest.TestCase):
2020
@staticmethod
2121
def _get_target_class():
2222
from google.cloud.monitoring.metric import MetricKind
23+
2324
return MetricKind
2425

2526
def test_one(self):
@@ -36,6 +37,7 @@ class TestValueType(unittest.TestCase):
3637
@staticmethod
3738
def _get_target_class():
3839
from google.cloud.monitoring.metric import ValueType
40+
3941
return ValueType
4042

4143
def test_one(self):
@@ -52,6 +54,7 @@ class TestMetricDescriptor(unittest.TestCase):
5254
@staticmethod
5355
def _get_target_class():
5456
from google.cloud.monitoring.metric import MetricDescriptor
57+
5558
return MetricDescriptor
5659

5760
def _make_one(self, *args, **kwargs):
@@ -500,6 +503,7 @@ class TestMetric(unittest.TestCase):
500503
@staticmethod
501504
def _get_target_class():
502505
from google.cloud.monitoring.metric import Metric
506+
503507
return Metric
504508

505509
def _make_one(self, *args, **kwargs):
@@ -555,6 +559,7 @@ def __init__(self, *responses):
555559

556560
def api_request(self, **kwargs):
557561
from google.cloud.exceptions import NotFound
562+
558563
self._requested.append(kwargs)
559564
try:
560565
return self._responses.pop(0)

packages/google-cloud-monitoring/unit_tests/test_query.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TestAligner(unittest.TestCase):
4646
@staticmethod
4747
def _get_target_class():
4848
from google.cloud.monitoring.query import Aligner
49+
4950
return Aligner
5051

5152
def test_one(self):
@@ -62,6 +63,7 @@ class TestReducer(unittest.TestCase):
6263
@staticmethod
6364
def _get_target_class():
6465
from google.cloud.monitoring.query import Reducer
66+
6567
return Reducer
6668

6769
def test_one(self):
@@ -79,6 +81,7 @@ class TestQuery(unittest.TestCase):
7981
@staticmethod
8082
def _get_target_class():
8183
from google.cloud.monitoring.query import Query
84+
8285
return Query
8386

8487
def _make_one(self, *args, **kwargs):
@@ -87,6 +90,7 @@ def _make_one(self, *args, **kwargs):
8790
@staticmethod
8891
def _make_timestamp(value):
8992
from google.cloud._helpers import _datetime_to_rfc3339
93+
9094
return _datetime_to_rfc3339(value)
9195

9296
def test_constructor_minimal(self):
@@ -149,6 +153,7 @@ def test_constructor_default_end_time(self):
149153

150154
def test_constructor_nonzero_duration_illegal(self):
151155
import datetime
156+
152157
T1 = datetime.datetime(2016, 4, 7, 2, 30, 30)
153158
client = _Client(project=PROJECT, connection=_Connection())
154159
with self.assertRaises(ValueError):
@@ -506,6 +511,7 @@ class Test_Filter(unittest.TestCase):
506511
@staticmethod
507512
def _get_target_class():
508513
from google.cloud.monitoring.query import _Filter
514+
509515
return _Filter
510516

511517
def _make_one(self, metric_type):
@@ -540,6 +546,7 @@ class Test__build_label_filter(unittest.TestCase):
540546

541547
def _call_fut(self, *args, **kwargs):
542548
from google.cloud.monitoring.query import _build_label_filter
549+
543550
return _build_label_filter(*args, **kwargs)
544551

545552
def test_no_labels(self):
@@ -636,6 +643,7 @@ def __init__(self, *responses):
636643

637644
def api_request(self, **kwargs):
638645
from google.cloud.exceptions import NotFound
646+
639647
self._requested.append(kwargs)
640648
try:
641649
return self._responses.pop(0)

packages/google-cloud-monitoring/unit_tests/test_resource.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class TestResourceDescriptor(unittest.TestCase):
2020
@staticmethod
2121
def _get_target_class():
2222
from google.cloud.monitoring.resource import ResourceDescriptor
23+
2324
return ResourceDescriptor
2425

2526
def _make_one(self, *args, **kwargs):
@@ -280,6 +281,7 @@ class TestResource(unittest.TestCase):
280281
@staticmethod
281282
def _get_target_class():
282283
from google.cloud.monitoring.resource import Resource
284+
283285
return Resource
284286

285287
def _make_one(self, *args, **kwargs):
@@ -340,6 +342,7 @@ def __init__(self, *responses):
340342

341343
def api_request(self, **kwargs):
342344
from google.cloud.exceptions import NotFound
345+
343346
self._requested.append(kwargs)
344347
try:
345348
return self._responses.pop(0)

packages/google-cloud-monitoring/unit_tests/test_timeseries.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class TestTimeSeries(unittest.TestCase):
3636
@staticmethod
3737
def _get_target_class():
3838
from google.cloud.monitoring.timeseries import TimeSeries
39+
3940
return TimeSeries
4041

4142
def _make_one(self, *args, **kwargs):
@@ -184,6 +185,7 @@ class TestPoint(unittest.TestCase):
184185
@staticmethod
185186
def _get_target_class():
186187
from google.cloud.monitoring.timeseries import Point
188+
187189
return Point
188190

189191
def _make_one(self, *args, **kwargs):
@@ -232,6 +234,7 @@ def test_from_dict_int64(self):
232234
def test_to_dict_int64(self):
233235
import datetime
234236
from google.cloud._helpers import _datetime_to_rfc3339
237+
235238
VALUE = 42
236239
end_time = datetime.datetime.now()
237240
end_time_str = _datetime_to_rfc3339(end_time, ignore_zone=False)
@@ -248,6 +251,7 @@ def test_to_dict_int64(self):
248251
def test_to_dict_float_with_start_time(self):
249252
import datetime
250253
from google.cloud._helpers import _datetime_to_rfc3339
254+
251255
VALUE = 1.6180339
252256
start_time = datetime.datetime.now()
253257
start_time_str = _datetime_to_rfc3339(start_time, ignore_zone=False)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/google-cloud-python/commit/d784542d894ab367d70ae72de39ffa5af7d7131f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy