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