Michael Foord added the comment:

Or create a JsonMatcher class that does it for you.


class JsonMatcher(object):
   def __init__(self, expected):
       self.expected = expected

   def __eq__(self, other):
       return json.loads(other) == self.expected

q.tranport.assert_called_once_with(JsonMatcher(expected), (PEER, PORT))

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17063>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to