@@ -21,19 +21,13 @@ def _make_one(self, *args, **kwargs):
2121 BigtableClientSideMetricsController ,
2222 )
2323
24- # add mock interceptor if called with no arguments
25- if not args and "interceptor" not in kwargs :
26- args = [mock .Mock ()]
27-
2824 return BigtableClientSideMetricsController (* args , ** kwargs )
2925
3026 def test_ctor_defaults (self ):
3127 """
3228 should create instance with GCP Exporter handler by default
3329 """
34- expected_interceptor = object ()
35- instance = self ._make_one (expected_interceptor )
36- assert instance .interceptor == expected_interceptor
30+ instance = self ._make_one ()
3731 assert len (instance .handlers ) == 0
3832
3933 def ctor_custom_handlers (self ):
@@ -92,22 +86,4 @@ def test_create_operation(self):
9286 assert op .is_streaming is expected_is_streaming
9387 assert op .zone is expected_zone
9488 assert len (op .handlers ) == 1
95- assert op .handlers [0 ] is handler
96-
97- def test_create_operation_registers_interceptor (self ):
98- """
99- creating an operation should link the operation with the controller's interceptor,
100- and add the interceptor as a handler to the operation
101- """
102- from google .cloud .bigtable .data ._sync_autogen .metrics_interceptor import (
103- BigtableMetricsInterceptor ,
104- )
105-
106- custom_handler = object ()
107- controller = self ._make_one (
108- BigtableMetricsInterceptor (), handlers = [custom_handler ]
109- )
110- op = controller .create_operation (object ())
111- assert custom_handler in op .handlers
112- assert op .uuid in controller .interceptor .operation_map
113- assert controller .interceptor .operation_map [op .uuid ] == op
89+ assert op .handlers [0 ] is handler
0 commit comments