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

Method test_take_while

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

Source from the content-addressed store, hash-verified

229 self.assertIteratorEqual(s.take(-1), self.seq([]))
230
231 def test_take_while(self):
232 l = [1, 2, 3, 4, 5, 6, 7, 8]
233 f = lambda x: x < 4
234 expect = [1, 2, 3]
235 result = self.seq(l).take_while(f)
236 self.assertIteratorEqual(result, expect)
237 self.assert_type(result)
238
239 def test_union(self):
240 result = self.seq([1, 1, 2, 3, 3]).union([1, 4, 5])

Callers

nothing calls this directly

Calls 3

assertIteratorEqualMethod · 0.95
assert_typeMethod · 0.95
take_whileMethod · 0.80

Tested by

no test coverage detected