(self)
| 106 | |
| 107 | class TestApplication(TestCase): |
| 108 | def test_log(self): |
| 109 | stream = StringIO() |
| 110 | app = MyApp(log_level=logging.INFO) |
| 111 | handler = logging.StreamHandler(stream) |
| 112 | # trigger reconstruction of the log formatter |
| 113 | app.log_format = "%(message)s" |
| 114 | app.log_datefmt = "%Y-%m-%d %H:%M" |
| 115 | app.log.handlers = [handler] |
| 116 | app.log.info("hello") |
| 117 | assert "hello" in stream.getvalue() |
| 118 | |
| 119 | def test_no_eval_cli_text(self): |
| 120 | app = MyApp() |