When calling unittest.TestCase.assertEqual()
on two complex dictionaries, I get a nice diff.
Is there any way to get a diff from Python 2.7's mock.Mock.assert_called_with
? I'm testing calls that take some dict parameters with complex values, and it's very difficult to see what the problem is when one of them is just missing a boolean.
e.g.
AssertionError: Expected call: post('http://cloud-atlas.cogolo.net/api/executions', auth=('cloudatlas', 'cloudatlas'), data={'environment': 'hadoop', 'source': 'repo', 'output_path': 'hdfs://namenode-01/user/erose/testing', 'production': True, 'input_path': 'hdfs://namenode-01/foo/bar', 'name': 'linecount', 'mrcloud_options': '{"mrcloud_option_A": "foobar", "hadoop_user_name": "erose"}', 'details': '{"path_to_file": "linecount.py", "parameters": {}, "branch": "master", "repo_name": "example_repo"}'}, headers={'X-COGO-CLOUDATLAS-USER': 'erose'})
Actual call: post('http://cloud-atlas.cogolo.net/api/executions', auth=('cloudatlas', 'cloudatlas'), data={'input_path': 'hdfs://namenode-01/foo/bar', 'name': 'linecount', 'environment': 'hadoop', 'source': 'repo', 'output_path': 'hdfs://namenode-01/user/erose/testing', 'details': '{"path_to_file": "linecount.py", "parameters": {}, "branch": "master", "repo_name": "example_repo"}', 'mrcloud_options': '{"mrcloud_option_A": "foobar", "hadoop_user_name": "erose"}'}, headers={'X-COGO-CLOUDATLAS-USER': 'erose'})