Skip to content

Commit

Permalink
add wrap_all test
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed May 26, 2016
1 parent 32cd651 commit da334eb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lithoxyl/tests/test_wrap_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

import json

from lithoxyl import Logger, AggregateSink
from lithoxyl.utils import wrap_all, unwrap_all


def test_wrap_all_json():
agg_sink = AggregateSink()
log = Logger('wrapper_log', sinks=[agg_sink])

wrap_all(log, 'info', json)

json.loads('{}')

assert agg_sink.begin_events[0].name == 'json.loads'

unwrap_all(json)

json.loads('{}')

assert len(agg_sink.begin_events) == 1

return

0 comments on commit da334eb

Please sign in to comment.