Skip to content

Commit

Permalink
Even more tests for log
Browse files Browse the repository at this point in the history
  • Loading branch information
dmvieira committed Apr 20, 2020
1 parent 3e86f3a commit ec3956e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_hooks/test_logging.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from asynctest import TestCase, Mock, patch
from barterdude.hooks.logging import Logging

Expand All @@ -9,6 +10,20 @@ def setUp(self):
self.message = Mock()
self.logging = Logging()

async def test_should_access_logger(self):
log = Logging("my_log", logging.DEBUG)
logger = log.logger
self.assertEqual(
type(logger),
logging.Logger
)
self.assertEqual(
type(logger.handlers[0]),
logging.StreamHandler
)
self.assertEqual(logger.name, "my_log")
self.assertEqual(logger.level, logging.DEBUG)

@patch("barterdude.hooks.logging.Logging.logger")
@patch("barterdude.hooks.logging.json.dumps")
async def test_should_log_before_consume(self, dumps, logger):
Expand Down

0 comments on commit ec3956e

Please sign in to comment.