MCPcopy Index your code
hub / github.com/python/cpython / test_patma_198

Method test_patma_198

Lib/test/test_patma.py:2065–2089  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2063 self.assertIs(z, 0)
2064
2065 def test_patma_198(self):
2066 class Color(enum.Enum):
2067 RED = 0
2068 GREEN = 1
2069 BLUE = 2
2070 def f(color):
2071 match color:
2072 case Color.RED:
2073 return "I see red!"
2074 case Color.GREEN:
2075 return "Grass is green"
2076 case Color.BLUE:
2077 return "I'm feeling the blues :("
2078 self.assertEqual(f(Color.RED), "I see red!")
2079 self.assertEqual(f(Color.GREEN), "Grass is green")
2080 self.assertEqual(f(Color.BLUE), "I'm feeling the blues :(")
2081 self.assertIs(f(Color), None)
2082 self.assertIs(f(0), None)
2083 self.assertIs(f(1), None)
2084 self.assertIs(f(2), None)
2085 self.assertIs(f(3), None)
2086 self.assertIs(f(False), None)
2087 self.assertIs(f(True), None)
2088 self.assertIs(f(2+0j), None)
2089 self.assertIs(f(3.0), None)
2090
2091 def test_patma_199(self):
2092 class Color(int, enum.Enum):

Callers

nothing calls this directly

Calls 3

fFunction · 0.70
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected