Exemple #1
0
    def test_update_security_marks(self):
        # Setup Expected Response
        name = "name3373707"
        expected_response = {"name": name}
        expected_response = security_marks_pb2.SecurityMarks(
            **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 = securitycenter_v1beta1.SecurityCenterClient()

        # Setup Request
        security_marks = {}

        response = client.update_security_marks(security_marks)
        assert expected_response == response

        assert len(channel.requests) == 1
        expected_request = securitycenter_service_pb2.UpdateSecurityMarksRequest(
            security_marks=security_marks)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
Exemple #2
0
    def test_update_security_marks(self):
        # Setup Expected Response
        name = 'name3373707'
        expected_response = {'name': name}
        expected_response = security_marks_pb2.SecurityMarks(
            **expected_response)

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

        # Setup Request
        security_marks = {}

        response = client.update_security_marks(security_marks)
        assert expected_response == response

        assert len(channel.requests) == 1
        expected_request = securitycenter_service_pb2.UpdateSecurityMarksRequest(
            security_marks=security_marks)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request