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

Method test_patma_198

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

Source from the content-addressed store, hash-verified

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