Exemple #1
0
 def test_thread_entry(self):
     """Thread event should be written to debug log only."""
     log = mock.Mock()
     access_log = mock.Mock()
     instance = server.EventletLogFilter(log, access_log=access_log)
     instance.write("(123) accepted ('127.0.0.1', 678)\n")
     log.debug.assert_called_once_with("(123) accepted ('127.0.0.1', 678)")
     access_log.write.assert_not_called()
Exemple #2
0
 def test_wsgi_entry(self):
     """wsgi event should be written to debug log only."""
     log = mock.Mock()
     access_log = mock.Mock()
     instance = server.EventletLogFilter(log, access_log=access_log)
     instance.write("wsgi exiting\n")
     log.debug.assert_called_once_with("wsgi exiting")
     access_log.write.assert_not_called()
Exemple #3
0
 def test_call_entry(self):
     """Callevent should be written to info and access logs."""
     log = mock.Mock()
     access_log = mock.Mock()
     instance = server.EventletLogFilter(log, access_log=access_log)
     entry = '127.0.0.1 - [07/Jul/2015] "GET / HTTP/1.1" 200'
     instance.write(entry + "\n")
     log.info.assert_called_once_with(entry)
     access_log.write.assert_called_once_with(entry + "\n")