Michael Foord added the comment:

Note that there is nothing stopping you using the mock.ANY and 
assert_called_once_with style assert currently. You're making your assert more 
clumsy than it needs to be.

With my proposal you could write:

    q.tranport.assert_called_once_with(mock.ANY, (PEER, PORT))
    dgram = q.tranport.call_args.args[0]
    self.assertEqual(json.loads(dgram),expected)

You could currently be doing:

    q.tranport.assert_called_once_with(mock.ANY, (PEER, PORT))
    dgram = q.tranport.call_args[0][0]
    self.assertEqual(json.loads(dgram), expected)

----------
assignee:  -> michael.foord

_______________________________________
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