| 1217 | self.fail(self._formatMessage(msg, standardMsg)) |
| 1218 | |
| 1219 | def assertDictEqual(self, d1, d2, msg=None): |
| 1220 | self.assertIsInstance(d1, dict, 'First argument is not a dictionary') |
| 1221 | self.assertIsInstance(d2, dict, 'Second argument is not a dictionary') |
| 1222 | |
| 1223 | if d1 != d2: |
| 1224 | standardMsg = '%s != %s' % _common_shorten_repr(d1, d2) |
| 1225 | diff = ('\n' + '\n'.join(difflib.ndiff( |
| 1226 | pprint.pformat(d1).splitlines(), |
| 1227 | pprint.pformat(d2).splitlines()))) |
| 1228 | standardMsg = self._truncateMessage(standardMsg, diff) |
| 1229 | self.fail(self._formatMessage(msg, standardMsg)) |
| 1230 | |
| 1231 | def assertCountEqual(self, first, second, msg=None): |
| 1232 | """Asserts that two iterables have the same elements, the same number of |