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

Method test_patma_182

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

Source from the content-addressed store, hash-verified

1876 self.assertIs(whereis(Point(0, 0)), None)
1877
1878 def test_patma_182(self):
1879 def whereis(points):
1880 match points:
1881 case []:
1882 return "No points"
1883 case [Point(0, 0)]:
1884 return "The origin"
1885 case [Point(x, y)]:
1886 return f"Single point {x}, {y}"
1887 case [Point(0, y1), Point(0, y2)]:
1888 return f"Two on the Y axis at {y1}, {y2}"
1889 case _:
1890 return "Something else"
1891 self.assertEqual(whereis([]), "No points")
1892 self.assertEqual(whereis([Point(0, 0)]), "The origin")
1893 self.assertEqual(whereis([Point(0, 1)]), "Single point 0, 1")
1894 self.assertEqual(whereis([Point(0, 0), Point(0, 0)]), "Two on the Y axis at 0, 0")
1895 self.assertEqual(whereis([Point(0, 1), Point(0, 1)]), "Two on the Y axis at 1, 1")
1896 self.assertEqual(whereis([Point(0, 0), Point(1, 0)]), "Something else")
1897 self.assertEqual(whereis([Point(0, 0), Point(0, 0), Point(0, 0)]), "Something else")
1898 self.assertEqual(whereis([Point(0, 1), Point(0, 1), Point(0, 1)]), "Something else")
1899
1900 def test_patma_183(self):
1901 def whereis(point):

Callers

nothing calls this directly

Calls 2

PointClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected