MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_extending3

Method test_extending3

Lib/test/test_enum.py:2552–2563  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2550 yellow = 6
2551
2552 def test_extending3(self):
2553 class Shade(Enum):
2554 def shade(self):
2555 return self.name
2556 class Color(Shade):
2557 def hex(self):
2558 return '%s hexlified!' % self.value
2559 class MoreColor(Color):
2560 cyan = 4
2561 magenta = 5
2562 yellow = 6
2563 self.assertEqual(MoreColor.magenta.hex(), '5 hexlified!')
2564
2565 def test_subclass_duplicate_name(self):
2566 class Base(Enum):

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.45
hexMethod · 0.45

Tested by

no test coverage detected