Example #1
0
 def test_number_of_none(self):
     expected = [0, 1, 2]
     actual = list(take(None, range(3)))
     self.assertEqual(actual, expected)
Example #2
0
 def test_number_negative(self):
     expected = []
     actual = list(take(-1, range(3)))
     self.assertEqual(actual, expected)
Example #3
0
 def test_number_smaller(self):
     expected = [0, 1]
     actual = list(take(2, range(3)))
     self.assertEqual(actual, expected)
Example #4
0
 def test_number_larger(self):
     expected = [0, 1, 2]
     actual = list(take(5, range(3)))
     self.assertEqual(actual, expected)
Example #5
0
 def test_number_of_zero(self):
     expected = []
     actual = list(take(0, range(3)))
     self.assertEqual(actual, expected)