(self, key, args, kwds)
| 135 | self.namespace = namespace |
| 136 | |
| 137 | def get_value(self, key, args, kwds): |
| 138 | if isinstance(key, str): |
| 139 | try: |
| 140 | # Check explicitly passed arguments first |
| 141 | return kwds[key] |
| 142 | except KeyError: |
| 143 | return self.namespace[key] |
| 144 | else: |
| 145 | string.Formatter.get_value(key, args, kwds) |
| 146 | |
| 147 | fmt = NamespaceFormatter({'greeting':'hello'}) |
| 148 | self.assertEqual(fmt.format("{greeting}, world!"), 'hello, world!') |
no outgoing calls
no test coverage detected