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

Method test_patma_182

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

PointClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected