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

Method test_patma_199

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

fFunction · 0.70
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected