Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
igrek51 committed Feb 16, 2024
1 parent 14602e7 commit 6646e51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/sublog/test_context_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def test_context_logger():
logger.warn('im a root')

logger2.debug('logged out')
logger.debug(42)
logger.debug('42')

# datetime
mockio.assert_match('^\x1b\\[2m\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\]\x1b\\[0m ')
mockio.assert_match('^\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\] ')
# log level
mockio.assert_match(' \x1b\\[32mDEBUG\x1b\\[0m ')
mockio.assert_match(' DEBUG ')
# message with context
mockio.assert_match(' got request \x1b\\[32mrequest_id=\x1b\\[1m3735936685\x1b\\[0m$')
mockio.assert_match(' got request request_id=3735936685$')

mockio.assert_match_uncolor('INFO logged in request_id=3735936685 user=igrek page="sweet home"$')
mockio.assert_match_uncolor('WARN im a root$')
Expand Down

0 comments on commit 6646e51

Please sign in to comment.