Message183216
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) |
|
Date |
User |
Action |
Args |
2013-02-28 12:14:02 | michael.foord | set | recipients:
+ michael.foord, pitrou, ezio.melotti |
2013-02-28 12:14:02 | michael.foord | set | messageid: <1362053642.66.0.520371338559.issue17063@psf.upfronthosting.co.za> |
2013-02-28 12:14:02 | michael.foord | link | issue17063 messages |
2013-02-28 12:14:02 | michael.foord | create | |
|