Beispiel #1
0
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().max(), 6)
Beispiel #2
0
 def test_flatMap(self):
     self.assertTrue(sources.flatMap().any_matches(lambda k: k - 2 == 0))
Beispiel #3
0
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().first(), 1)
Beispiel #4
0
 def test_flatMap(self):
     self.assertTupleEqual(sources.flatMap().statistics(), NumberStatistics(21, 6, 1, 6, 3.5))
Beispiel #5
0
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().average(), 3.5)
Beispiel #6
0
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().join(', '), '1, 2, 3, 4, 5, 6')
Beispiel #7
0
 def test_flatMap(self):
     self.assertListEqual(sources.flatMap().to_list(), [1, 2, 3, 4, 5, 6])
Beispiel #8
0
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().sum(), 21)
Beispiel #9
0
 def test_flatMap(self):
     self.assertListEqual(sources.flatMap().chunk(4).to_list(),
                          [[1, 2, 3, 4], [5, 6]])
Beispiel #10
0
 def test_flatMap(self):
     self.assertFalse(sources.flatMap().all_matches(lambda k: k - 2 == 0))
Beispiel #11
0
 def test_flatMap_handling_duplicates(self):
     self.assertDictEqual(
         sources.flatMap().to_dictionary(lambda _: 0, lambda k: k,
                                         lambda k, oldValue, _: oldValue),
         {0: 1})
Beispiel #12
0
 def test_flatMap(self):
     self.assertListEqual(forEachOpHelper(sources.flatMap()),
                          [1, 2, 3, 4, 5, 6])