def METHOD_NAME(self):
    class NamespaceFormatter(string.Formatter):
        def __init__(self, namespace={}):
            string.Formatter.__init__(self)
            self.namespace = namespace
        def get_value(self, key, args, kwds):
            if isinstance(key, str):
                try:
                    # Check explicitly passed arguments first
                    return kwds[key]
                except KeyError:
                    return self.namespace[key]
            else:
                string.Formatter.get_value(key, args, kwds)
    fmt = NamespaceFormatter({'greeting':'hello'})
    self.assertEqual(fmt.format("{greeting}, world!"), 'hello, world!')