MCPcopy Index your code
hub / github.com/RustPython/RustPython / assertDictEqual

Method assertDictEqual

Lib/unittest/case.py:1219–1229  ·  view source on GitHub ↗
(self, d1, d2, msg=None)

Source from the content-addressed store, hash-verified

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

Calls 8

assertIsInstanceMethod · 0.95
_truncateMessageMethod · 0.95
failMethod · 0.95
_formatMessageMethod · 0.95
_common_shorten_reprFunction · 0.85
pformatMethod · 0.80
joinMethod · 0.45
splitlinesMethod · 0.45