MCPcopy Index your code
hub / github.com/python/cpython / test_get

Method test_get

Lib/test/mapping_tests.py:485–494  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

483 self.assertRaises(TypeError, d.copy, None)
484
485 def test_get(self):
486 BasicTestMappingProtocol.test_get(self)
487 d = self._empty_mapping()
488 self.assertTrue(d.get('c') is None)
489 self.assertEqual(d.get('c', 3), 3)
490 d = self._full_mapping({'a' : 1, 'b' : 2})
491 self.assertTrue(d.get('c') is None)
492 self.assertEqual(d.get('c', 3), 3)
493 self.assertEqual(d.get('a'), 1)
494 self.assertEqual(d.get('a', 3), 1)
495
496 def test_setdefault(self):
497 BasicTestMappingProtocol.test_setdefault(self)

Callers

nothing calls this directly

Calls 5

assertTrueMethod · 0.80
_empty_mappingMethod · 0.45
getMethod · 0.45
assertEqualMethod · 0.45
_full_mappingMethod · 0.45

Tested by

no test coverage detected