Skip to content

Commit

Permalink
Fix coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Dec 29, 2016
1 parent 454edcd commit 38e46d5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions core/unit_tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,33 @@ def test_it(self):
secure_authorized_channel.assert_called_once_with(
credentials, mock.ANY, expected_target, options=expected_options)

def test_extra_options(self):
from six.moves import http_client

credentials = object()
host = 'HOST'
user_agent = 'USER_AGENT'
extra_options = (('some', 'option'),)

secure_authorized_channel_patch = mock.patch(
'google.auth.transport.grpc.secure_authorized_channel',
autospec=True)

with secure_authorized_channel_patch as secure_authorized_channel:
result = self._call_fut(credentials, user_agent, host,
extra_options)

self.assertIs(result, secure_authorized_channel.return_value)

expected_target = '%s:%d' % (host, http_client.HTTPS_PORT)
expected_options = (
('grpc.primary_user_agent', user_agent),
extra_options[0],
)

secure_authorized_channel.assert_called_once_with(
credentials, mock.ANY, expected_target, options=expected_options)


class Test_make_secure_stub(unittest.TestCase):

Expand Down

0 comments on commit 38e46d5

Please sign in to comment.