Lines Matching refs:format_map
1298 self.assertEqual(''.format_map({}), '')
1299 self.assertEqual('a'.format_map({}), 'a')
1300 self.assertEqual('ab'.format_map({}), 'ab')
1301 self.assertEqual('a{{'.format_map({}), 'a{')
1302 self.assertEqual('a}}'.format_map({}), 'a}')
1303 self.assertEqual('{{b'.format_map({}), '{b')
1304 self.assertEqual('}}b'.format_map({}), '}b')
1305 self.assertEqual('a{{b'.format_map({}), 'a{b')
1311 self.assertEqual('{hello}'.format_map(Mapping()), 'hello')
1312 self.assertEqual('{a} {world}'.format_map(Mapping(a='hello')), 'hello world')
1319 self.assertEqual('{a}'.format_map(InternalMapping()), 'hello')
1327 self.assertEqual('{foo._x}'.format_map({'foo': C(20)}), '20')
1330 self.assertRaises(TypeError, ''.format_map)
1331 self.assertRaises(TypeError, 'a'.format_map)
1333 self.assertRaises(ValueError, '{'.format_map, {})
1334 self.assertRaises(ValueError, '}'.format_map, {})
1335 self.assertRaises(ValueError, 'a{'.format_map, {})
1336 self.assertRaises(ValueError, 'a}'.format_map, {})
1337 self.assertRaises(ValueError, '{a'.format_map, {})
1338 self.assertRaises(ValueError, '}a'.format_map, {})
1341 self.assertRaises(ValueError, '{}'.format_map, {'a' : 2})
1342 self.assertRaises(ValueError, '{}'.format_map, 'a')
1343 self.assertRaises(ValueError, '{a} {}'.format_map, {"a" : 2, "b" : 1})
1348 self.assertRaises(KeyError, '{a}'.format_map, {})
1349 self.assertRaises(TypeError, '{a}'.format_map, [])
1350 self.assertRaises(ZeroDivisionError, '{a}'.format_map, BadMapping())