def test_import_ssh_public_key(self):
        # Setup Expected Response
        expected_response = {}
        expected_response = oslogin_pb2.ImportSshPublicKeyResponse(
            **expected_response)

        # Mock the API response
        channel = ChannelStub(responses=[expected_response])
        patch = mock.patch("google.api_core.grpc_helpers.create_channel")
        with patch as create_channel:
            create_channel.return_value = channel
            client = oslogin_v1.OsLoginServiceClient()

        # Setup Request
        parent = client.user_path("[USER]")
        ssh_public_key = {}

        response = client.import_ssh_public_key(parent, ssh_public_key)
        assert expected_response == response

        assert len(channel.requests) == 1
        expected_request = oslogin_pb2.ImportSshPublicKeyRequest(
            parent=parent, ssh_public_key=ssh_public_key)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
    def test_import_ssh_public_key(self):
        # Setup Expected Response
        expected_response = {}
        expected_response = oslogin_pb2.ImportSshPublicKeyResponse(
            **expected_response)

        # Mock the API response
        channel = ChannelStub(responses=[expected_response])
        client = oslogin_v1.OsLoginServiceClient(channel=channel)

        # Setup Request
        parent = client.user_path('[USER]')
        ssh_public_key = {}

        response = client.import_ssh_public_key(parent, ssh_public_key)
        assert expected_response == response

        assert len(channel.requests) == 1
        expected_request = oslogin_pb2.ImportSshPublicKeyRequest(
            parent=parent, ssh_public_key=ssh_public_key)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request