Пример #1
0
    def test__sample_request_no_sample(self, mocklog):
        e = RPCResponseEndpointUnit(interceptors={})

        e._get_sflow_manager = Mock(return_value=Mock(spec=SFlowManager))
        e._get_sflow_manager.return_value.should_sample = False
        e._get_sample_name = Mock()

        e._sample_request(sentinel.status, sentinel.status_descr, sentinel.msg, sentinel.headers, sentinel.response, sentinel.response_headers)

        self.assertEquals(mocklog.debug.call_count, 1)
        self.assertIn("not to sample", mocklog.debug.call_args[0][0])
Пример #2
0
    def test__sample_request_no_sample(self, mocklog):
        e = RPCResponseEndpointUnit(interceptors={})

        e._get_sflow_manager = Mock(return_value=Mock(spec=SFlowManager))
        e._get_sflow_manager.return_value.should_sample = False
        e._get_sample_name = Mock()

        e._sample_request(sentinel.status, sentinel.status_descr, sentinel.msg,
                          sentinel.headers, sentinel.response,
                          sentinel.response_headers)

        self.assertEquals(mocklog.debug.call_count, 1)
        self.assertIn("not to sample", mocklog.debug.call_args[0][0])
Пример #3
0
 def test__get_sample_name(self):
     e = RPCResponseEndpointUnit(interceptors={})
     self.assertEquals(e._get_sample_name(), "unknown-rpc-server")
Пример #4
0
 def test__get_sample_name(self):
     e = RPCResponseEndpointUnit(interceptors={})
     self.assertEquals(e._get_sample_name(), "unknown-rpc-server")