How to get a diff from python's `mock.assert_called_with()`? -


when calling unittest.testcase.assertequal() on 2 complex dictionaries, nice diff.

is there way diff python 2.7's mock.mock.assert_called_with? i'm testing calls take dict parameters complex values, , it's difficult see problem when 1 of them missing 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'}) 


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -