示例#1
0
 def test_close_noop_if_not_init(self):
     """
     libhoney.close() should noop if never initialized
     """
     try:
         libhoney.close()
     except AttributeError:
         self.fail('libhoney threw an exception on '
                   'an uninitialized close.')
示例#2
0
 def test_close_noop_if_not_init(self):
     """
     libhoney.close() should noop if never initialized
     """
     try:
         libhoney.close()
     except AttributeError:
         self.fail('libhoney threw an exception on '
                   'an uninitialized close.')
示例#3
0
    def post_report(self, report):
        local_rep = copy.deepcopy(report.report)
        format_report(local_rep)
        try:
            send_honeycomb(local_rep, self.config)
        except Exception as e:
            logger.debug("caught exception while sending report: {}".format(e))
        finally:
            logger.debug("sent report to honeycomb")

        responses = libhoney.responses()
        resp = responses.get()
        if resp is None:
            logger.info("no response from honeycomb")
        else:
            logger.debug("got response from Honeycomb: {}".format(resp))
        libhoney.close()
 def setUp(self):
     # reset global state with each test
     libhoney.close()
示例#5
0
    def setUp(self):
        libhoney.close()

        self.tx = mock.Mock()
        self.m_xmit = mock.patch('libhoney.client.Transmission')
        self.m_xmit.start().return_value = self.tx
示例#6
0
 def test_close(self):
     mock_client = mock.Mock()
     libhoney.state.G_CLIENT = mock_client
     libhoney.close()
     mock_client.close.assert_called_with()
     self.assertEqual(libhoney.state.G_CLIENT, None)
示例#7
0
 def setUp(self):
     # reset global state with each test
     libhoney.close()
     self.mock_xmit = mock.Mock(return_value=mock.Mock())
 def setUp(self):
     # reset global state with each test
     libhoney.close()
示例#9
0
 def test_close(self):
     mock_client = mock.Mock()
     libhoney.state.G_CLIENT = mock_client
     libhoney.close()
     mock_client.close.assert_called_with()
     self.assertEqual(libhoney.state.G_CLIENT, None)
示例#10
0
 def setUp(self):
     # reset global state with each test
     libhoney.close()
     self.mock_xmit = mock.Mock(return_value=mock.Mock())
示例#11
0
def graceful_shutdown(signum, frame):
    libhoney.close()