File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -644,6 +644,33 @@ def test_it(self):
644644 secure_authorized_channel .assert_called_once_with (
645645 credentials , mock .ANY , expected_target , options = expected_options )
646646
647+ def test_extra_options (self ):
648+ from six .moves import http_client
649+
650+ credentials = object ()
651+ host = 'HOST'
652+ user_agent = 'USER_AGENT'
653+ extra_options = (('some' , 'option' ),)
654+
655+ secure_authorized_channel_patch = mock .patch (
656+ 'google.auth.transport.grpc.secure_authorized_channel' ,
657+ autospec = True )
658+
659+ with secure_authorized_channel_patch as secure_authorized_channel :
660+ result = self ._call_fut (credentials , user_agent , host ,
661+ extra_options )
662+
663+ self .assertIs (result , secure_authorized_channel .return_value )
664+
665+ expected_target = '%s:%d' % (host , http_client .HTTPS_PORT )
666+ expected_options = (
667+ ('grpc.primary_user_agent' , user_agent ),
668+ extra_options [0 ],
669+ )
670+
671+ secure_authorized_channel .assert_called_once_with (
672+ credentials , mock .ANY , expected_target , options = expected_options )
673+
647674
648675class Test_make_secure_stub (unittest .TestCase ):
649676
You can’t perform that action at this time.
0 commit comments