Skip to content

Commit 19fd83d

Browse files
committed
Removing un-needed PB mocks in GAX logging unit tests.
1 parent ae910fc commit 19fd83d

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

logging/unit_tests/test__gax.py

+8-20
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,10 @@ def test_sink_update_miss(self):
738738

739739
def test_sink_update_hit(self):
740740
from google.logging.v2.logging_config_pb2 import LogSink
741-
response = _LogSinkPB(
742-
self.SINK_NAME, self.FILTER, self.DESTINATION_URI)
741+
742+
response = LogSink(name=self.SINK_NAME,
743+
destination=self.DESTINATION_URI,
744+
filter=self.FILTER)
743745
gax_api = _GAXSinksAPI(_update_sink_response=response)
744746
api = self._makeOne(gax_api)
745747

@@ -951,8 +953,10 @@ def test_metric_update_miss(self):
951953

952954
def test_metric_update_hit(self):
953955
from google.logging.v2.logging_metrics_pb2 import LogMetric
954-
response = _LogMetricPB(
955-
self.METRIC_NAME, self.FILTER, self.DESCRIPTION)
956+
957+
response = LogMetric(name=self.METRIC_NAME,
958+
description=self.DESCRIPTION,
959+
filter=self.FILTER)
956960
gax_api = _GAXMetricsAPI(_update_log_metric_response=response)
957961
api = self._makeOne(gax_api)
958962

@@ -1109,19 +1113,3 @@ def delete_log_metric(self, metric_name, options=None):
11091113
raise GaxError('error')
11101114
if self._log_metric_not_found:
11111115
raise GaxError('notfound', self._make_grpc_not_found())
1112-
1113-
1114-
class _LogSinkPB(object):
1115-
1116-
def __init__(self, name, destination, filter_):
1117-
self.name = name
1118-
self.destination = destination
1119-
self.filter = filter_
1120-
1121-
1122-
class _LogMetricPB(object):
1123-
1124-
def __init__(self, name, description, filter_):
1125-
self.name = name
1126-
self.description = description
1127-
self.filter = filter_

0 commit comments

Comments
 (0)