MCPcopy Create free account
hub / github.com/RustPython/RustPython / BadMapping

Class BadMapping

Lib/test/test_str.py:1454–1456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1452 self.assertRaises(ValueError, '{a} {}'.format_map, {"a" : 2, "b" : 1})
1453
1454 class BadMapping:
1455 def __getitem__(self, key):
1456 return 1/0
1457 self.assertRaises(KeyError, '{a}'.format_map, {})
1458 self.assertRaises(TypeError, '{a}'.format_map, [])
1459 self.assertRaises(ZeroDivisionError, '{a}'.format_map, BadMapping())

Callers 1

test_format_mapMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_format_mapMethod · 0.68