def METHOD_NAME(self):
    fmt = string.Formatter()
    lookup = ["eggs", "and", "spam"]
    self.assertEqual(fmt.format("{0[2]}{0[0]}", lookup), 'spameggs')
    with self.assertRaises(IndexError):
        fmt.format("{0[2]}{0[0]}", [])
    with self.assertRaises(KeyError):
        fmt.format("{0[2]}{0[0]}", {})