MCPcopy Create free account
hub / github.com/celery/celery / test_datefmt

Method test_datefmt

t/unit/app/test_log.py:35–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 assert record.task_id == '???'
34
35 def test_datefmt(self):
36 record = logging.LogRecord(
37 'name', logging.INFO, 'path', 1, 'hello world', None, None,
38 )
39 x = TaskFormatter(
40 fmt='[%(asctime)s] %(task_name)s %(message)s',
41 datefmt='%Y%m%d-%H%M%S',
42 use_color=False,
43 )
44 assert x.datefmt == '%Y%m%d-%H%M%S'
45 asctime = x.format(record).split(']')[0].lstrip('[')
46 # the default asctime uses "-" and ":" separators plus a "," for msecs
47 assert ':' not in asctime and ',' not in asctime
48
49
50class test_logger_isa:

Callers

nothing calls this directly

Calls 2

formatMethod · 0.95
TaskFormatterClass · 0.90

Tested by

no test coverage detected