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

Method test_patma_199

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

Source from the content-addressed store, hash-verified

2089 self.assertIs(f(3.0), None)
2090
2091 def test_patma_199(self):
2092 class Color(int, enum.Enum):
2093 RED = 0
2094 GREEN = 1
2095 BLUE = 2
2096 def f(color):
2097 match color:
2098 case Color.RED:
2099 return "I see red!"
2100 case Color.GREEN:
2101 return "Grass is green"
2102 case Color.BLUE:
2103 return "I'm feeling the blues :("
2104 self.assertEqual(f(Color.RED), "I see red!")
2105 self.assertEqual(f(Color.GREEN), "Grass is green")
2106 self.assertEqual(f(Color.BLUE), "I'm feeling the blues :(")
2107 self.assertIs(f(Color), None)
2108 self.assertEqual(f(0), "I see red!")
2109 self.assertEqual(f(1), "Grass is green")
2110 self.assertEqual(f(2), "I'm feeling the blues :(")
2111 self.assertIs(f(3), None)
2112 self.assertEqual(f(False), "I see red!")
2113 self.assertEqual(f(True), "Grass is green")
2114 self.assertEqual(f(2+0j), "I'm feeling the blues :(")
2115 self.assertIs(f(3.0), None)
2116
2117 def test_patma_200(self):
2118 class Class:

Callers

nothing calls this directly

Calls 3

fFunction · 0.70
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected