def test_each(self): result = [] def f(x, i): result.append(x is None) _.each(self.arr, f) falsy = _.compose(_.isNot, _.truthy) self.assertTrue(_.some(result, falsy))
def test_compose(self): lastSecond = _.compose(_.first, _.rest, _.reverse) obj = lastSecond(self.arr) self.assertEqual(obj, {'c': 3})
def test_contains_and_has(self): self.assertTrue(self.arr, [2, 'b']) lastSecond = _.compose(_.first, _.rest, _.reverse) obj = lastSecond(self.arr) self.assertTrue(_.has(obj, 'c'))