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

Method test_patma_183

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

Source from the content-addressed store, hash-verified

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):
1902 match point:
1903 case Point(x, y) if x == y:
1904 return f"Y=X at {x}"
1905 case Point(x, y):
1906 return "Not on the diagonal"
1907 self.assertEqual(whereis(Point(0, 0)), "Y=X at 0")
1908 self.assertEqual(whereis(Point(0, False)), "Y=X at 0")
1909 self.assertEqual(whereis(Point(False, 0)), "Y=X at False")
1910 self.assertEqual(whereis(Point(-1 - 1j, -1 - 1j)), "Y=X at (-1-1j)")
1911 self.assertEqual(whereis(Point("X", "X")), "Y=X at X")
1912 self.assertEqual(whereis(Point("X", "x")), "Not on the diagonal")
1913
1914 def test_patma_184(self):
1915 class Seq(collections.abc.Sequence):

Callers

nothing calls this directly

Calls 2

PointClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected