Beispiel #1
0
 def test_takeWhile(self):
     self.assertDictEqual(
         sources.takeWhile().to_dictionary(lambda k: k % 2, lambda k: k,
                                           lambda k, _, newValue: newValue),
         {
             1: 1,
             0: 16
         })
Beispiel #2
0
 def test_takeWhile(self):
     self.assertEqual(sources.takeWhile().max(), 16)
Beispiel #3
0
 def test_takeWhile(self):
     self.assertEqual(sources.takeWhile().first(), 1)
Beispiel #4
0
 def test_takeWhile(self):
     self.assertTrue(sources.takeWhile().any_matches(lambda k: k < 10))
Beispiel #5
0
 def test_takeWhile(self):
     self.assertEqual(sources.takeWhile().average(), 6.2)
Beispiel #6
0
 def test_takeWhile(self):
     self.assertTupleEqual(sources.takeWhile().statistics(), NumberStatistics(31, 5, 1, 16, 6.2))
Beispiel #7
0
 def test_takeWhile(self):
     self.assertListEqual(sources.takeWhile().to_list(), [1, 2, 4, 8, 16])
Beispiel #8
0
 def test_takeWhile(self):
     self.assertEqual(sources.takeWhile().join(', '), '1, 2, 4, 8, 16')
Beispiel #9
0
 def test_takeWhile(self):
     self.assertEqual(sources.takeWhile().sum(), 31)
Beispiel #10
0
 def test_takeWhile(self):
     self.assertListEqual(sources.takeWhile().chunk(2).to_list(),
                          [[1, 2], [4, 8], [16]])
Beispiel #11
0
 def test_takeWhile(self):
     self.assertFalse(sources.takeWhile().all_matches(lambda k: k < 10))
Beispiel #12
0
 def test_takeWhile(self):
     self.assertListEqual(forEachOpHelper(sources.takeWhile()),
                          [1, 2, 4, 8, 16])
Beispiel #13
0
 def test_takeWhile(self):
     self.assertEqual(sources.takeWhile().count(), 5)