This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author michael.foord
Recipients ezio.melotti, michael.foord, pitrou
Date 2013-02-28.12:14:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362053642.66.0.520371338559.issue17063@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2013-02-28 12:14:02michael.foordsetrecipients: + michael.foord, pitrou, ezio.melotti
2013-02-28 12:14:02michael.foordsetmessageid: <1362053642.66.0.520371338559.issue17063@psf.upfronthosting.co.za>
2013-02-28 12:14:02michael.foordlinkissue17063 messages
2013-02-28 12:14:02michael.foordcreate