Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
    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))
Exemplo n.º 3
0
 def test_compose(self):
     lastSecond = _.compose(_.first, _.rest, _.reverse)
     obj = lastSecond(self.arr)
     self.assertEqual(obj, {'c': 3})
Exemplo n.º 4
0
 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'))
Exemplo n.º 5
0
 def test_compose(self):
   lastSecond = _.compose(_.first, _.rest, _.reverse)
   obj = lastSecond(self.arr)
   self.assertEqual(obj, {'c': 3})
Exemplo n.º 6
0
 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'))