def test_report_phishing(self):
        # Setup Expected Response
        expected_response = {}
        expected_response = phishingprotection_pb2.ReportPhishingResponse(
            **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 = phishingprotection_v1beta1.PhishingProtectionServiceClient(
            )

        # Setup Request
        parent = client.project_path("[PROJECT]")
        uri = "uri116076"

        response = client.report_phishing(parent, uri)
        assert expected_response == response

        assert len(channel.requests) == 1
        expected_request = phishingprotection_pb2.ReportPhishingRequest(
            parent=parent, uri=uri)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
    def test_report_phishing_exception(self):
        # Mock the API response
        channel = ChannelStub(responses=[CustomException()])
        patch = mock.patch("google.api_core.grpc_helpers.create_channel")
        with patch as create_channel:
            create_channel.return_value = channel
            client = phishingprotection_v1beta1.PhishingProtectionServiceClient()

        # Setup request
        parent = client.project_path("[PROJECT]")
        uri = "uri116076"

        with pytest.raises(CustomException):
            client.report_phishing(parent, uri)