@@ -900,9 +900,9 @@ def test_subscription_modify_ack_deadline_error(self):
900900@unittest .skipUnless (_HAVE_GAX , 'No gax-python' )
901901class Test_make_gax_publisher_api (_Base , unittest .TestCase ):
902902
903- def _call_fut (self , connection ):
903+ def _call_fut (self , * args , ** kwargs ):
904904 from google .cloud .pubsub ._gax import make_gax_publisher_api
905- return make_gax_publisher_api (connection )
905+ return make_gax_publisher_api (* args , ** kwargs )
906906
907907 def test_live_api (self ):
908908 from google .cloud .pubsub ._gax import DEFAULT_USER_AGENT
@@ -924,14 +924,12 @@ def make_channel(*args):
924924 mock_publisher_api .SERVICE_ADDRESS = host
925925
926926 creds = _make_credentials ()
927- connection = _Connection (in_emulator = False ,
928- credentials = creds )
929927 patch = mock .patch .multiple (
930928 'google.cloud.pubsub._gax' ,
931929 PublisherClient = mock_publisher_api ,
932930 make_secure_channel = make_channel )
933931 with patch :
934- result = self ._call_fut (connection )
932+ result = self ._call_fut (creds )
935933
936934 self .assertIs (result , mock_result )
937935 self .assertEqual (channels , [channel_obj ])
@@ -953,13 +951,12 @@ def mock_insecure_channel(host):
953951 return mock_channel
954952
955953 host = 'CURR_HOST:1234'
956- connection = _Connection (in_emulator = True , host = host )
957954 patch = mock .patch .multiple (
958955 'google.cloud.pubsub._gax' ,
959956 PublisherClient = mock_publisher_api ,
960957 insecure_channel = mock_insecure_channel )
961958 with patch :
962- result = self ._call_fut (connection )
959+ result = self ._call_fut (None , host = host , secure = False )
963960
964961 self .assertIs (result , mock_result )
965962 self .assertEqual (channels , [mock_channel ])
@@ -969,9 +966,9 @@ def mock_insecure_channel(host):
969966@unittest .skipUnless (_HAVE_GAX , 'No gax-python' )
970967class Test_make_gax_subscriber_api (_Base , unittest .TestCase ):
971968
972- def _call_fut (self , connection ):
969+ def _call_fut (self , * args , ** kwargs ):
973970 from google .cloud .pubsub ._gax import make_gax_subscriber_api
974- return make_gax_subscriber_api (connection )
971+ return make_gax_subscriber_api (* args , ** kwargs )
975972
976973 def test_live_api (self ):
977974 from google .cloud .pubsub ._gax import DEFAULT_USER_AGENT
@@ -993,14 +990,12 @@ def make_channel(*args):
993990 mock_subscriber_api .SERVICE_ADDRESS = host
994991
995992 creds = _make_credentials ()
996- connection = _Connection (in_emulator = False ,
997- credentials = creds )
998993 patch = mock .patch .multiple (
999994 'google.cloud.pubsub._gax' ,
1000995 SubscriberClient = mock_subscriber_api ,
1001996 make_secure_channel = make_channel )
1002997 with patch :
1003- result = self ._call_fut (connection )
998+ result = self ._call_fut (creds )
1004999
10051000 self .assertIs (result , mock_result )
10061001 self .assertEqual (channels , [channel_obj ])
@@ -1022,13 +1017,12 @@ def mock_insecure_channel(host):
10221017 return mock_channel
10231018
10241019 host = 'CURR_HOST:1234'
1025- connection = _Connection (in_emulator = True , host = host )
10261020 patch = mock .patch .multiple (
10271021 'google.cloud.pubsub._gax' ,
10281022 SubscriberClient = mock_subscriber_api ,
10291023 insecure_channel = mock_insecure_channel )
10301024 with patch :
1031- result = self ._call_fut (connection )
1025+ result = self ._call_fut (None , host = host , secure = False )
10321026
10331027 self .assertIs (result , mock_result )
10341028 self .assertEqual (channels , [mock_channel ])
@@ -1207,15 +1201,6 @@ def __init__(self, received_messages):
12071201 self .received_messages = received_messages
12081202
12091203
1210- class _Connection (object ):
1211-
1212- def __init__ (self , in_emulator = False , host = None ,
1213- credentials = None ):
1214- self .in_emulator = in_emulator
1215- self .host = host
1216- self .credentials = credentials
1217-
1218-
12191204class _Client (object ):
12201205
12211206 def __init__ (self , project ):
0 commit comments