def test_emit(self): """test basic emit""" handler = LogglyHandler('my_token', 'my_domain') handler.session = Mock() handler.format = Mock() handler.format.return_value = "foo" rec = Mock() handler.emit(rec) handler.format.assert_called_once_with(rec) handler.session.post.assert_called_once_with( handler.url, data="foo", background_callback=handler.resp_callback)