Skip to content

Commit

Permalink
comment for assert function
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed May 28, 2017
1 parent 5e186c6 commit 095041e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions unihan_etl/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@


def assert_dict_contains_subset(subset, dictionary, msg=None):
"""Ported assertion for dict subsets in py.test.
:param subset: needle
:type subset: dict
:param dictionary: haystack
:type dictionary: dict
:param msg: message for assert if failure found
:type msg: str
"""
for key, value in subset.items():
assert key in dictionary, msg
assert dictionary[key] == value, msg

0 comments on commit 095041e

Please sign in to comment.