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

Method test_last_option

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

Source from the content-addressed store, hash-verified

163 self.assert_type(l.last())
164
165 def test_last_option(self):
166 l = self.seq([1, 2, 3]).map(lambda x: x)
167 self.assertEqual(l.last_option(), 3)
168 l = self.seq([1, 2, [3, 4]]).map(lambda x: x)
169 self.assertEqual(l.last_option(), [3, 4])
170 self.assert_type(l.last_option())
171 l = self.seq([])
172 self.assertIsNone(l.last_option())
173
174 def test_init(self):
175 result = self.seq([1, 2, 3, 4]).map(lambda x: x).init()

Callers

nothing calls this directly

Calls 3

assert_typeMethod · 0.95
mapMethod · 0.80
last_optionMethod · 0.80

Tested by

no test coverage detected