Skip to content

Commit

Permalink
adding cheap test for BaseGELFHandler._set_custom_facility
Browse files Browse the repository at this point in the history
  • Loading branch information
nklapste committed Mar 12, 2019
1 parent f79a92e commit 722ce39
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/test_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ def test_status_field_issue(logger, mock_send):
assert "OK" == decoded["_status"]


def test_set_custom_facility():
gelf_dict = dict()
mock_log_record = logging.LogRecord(
"test name",
logging.INFO, None, None, None, None, None
)
facility = "test facility"
BaseGELFHandler._set_custom_facility(gelf_dict, facility, mock_log_record)
assert "test name" == gelf_dict["_logger"]
assert "test facility" == gelf_dict["facility"]


def test_formatted_logger(formatted_logger, mock_send):
"""Test the ability to set and modify the graypy handler's
:class:`logging.Formatter` and have the resultant ``short_message`` be
Expand Down

0 comments on commit 722ce39

Please sign in to comment.