(self)
| 455 | self.assertEqual(repr(Point.y), "_tuplegetter(1, 'The y-coordinate')") |
| 456 | |
| 457 | def test_name_fixer(self): |
| 458 | for spec, renamed in [ |
| 459 | [('efg', 'g%hi'), ('efg', '_1')], # field with non-alpha char |
| 460 | [('abc', 'class'), ('abc', '_1')], # field has keyword |
| 461 | [('8efg', '9ghi'), ('_0', '_1')], # field starts with digit |
| 462 | [('abc', '_efg'), ('abc', '_1')], # field with leading underscore |
| 463 | [('abc', 'efg', 'efg', 'ghi'), ('abc', 'efg', '_2', 'ghi')], # duplicate field |
| 464 | [('abc', '', 'x'), ('abc', '_1', 'x')], # fieldname is a space |
| 465 | ]: |
| 466 | self.assertEqual(namedtuple('NT', spec, rename=True)._fields, renamed) |
| 467 | |
| 468 | def test_module_parameter(self): |
| 469 | NT = namedtuple('NT', ['x', 'y'], module=collections) |
nothing calls this directly
no test coverage detected