MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / test_cartesian

Method test_cartesian

functional/test/test_functional.py:658–668  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

656 self.assert_type(result)
657
658 def test_cartesian(self):
659 result = seq.range(3).cartesian(range(3)).list()
660 self.assertListEqual(result, list(product(range(3), range(3))))
661
662 result = seq.range(3).cartesian(range(3), range(2)).list()
663 self.assertListEqual(result, list(product(range(3), range(3), range(2))))
664
665 result = seq.range(3).cartesian(range(3), range(2), repeat=2).list()
666 self.assertListEqual(
667 result, list(product(range(3), range(3), range(2), repeat=2))
668 )
669
670 def test_product(self):
671 l = [2, 2, 3]

Callers

nothing calls this directly

Calls 3

listMethod · 0.80
cartesianMethod · 0.80
rangeMethod · 0.80

Tested by

no test coverage detected