コード例 #1
0
ファイル: test_max.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().max(), 6)
コード例 #2
0
ファイル: test_any_matches.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertTrue(sources.flatMap().any_matches(lambda k: k - 2 == 0))
コード例 #3
0
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().first(), 1)
コード例 #4
0
ファイル: test_statistics.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertTupleEqual(sources.flatMap().statistics(), NumberStatistics(21, 6, 1, 6, 3.5))
コード例 #5
0
ファイル: test_average.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().average(), 3.5)
コード例 #6
0
ファイル: test_join.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().join(', '), '1, 2, 3, 4, 5, 6')
コード例 #7
0
ファイル: test_to_list.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertListEqual(sources.flatMap().to_list(), [1, 2, 3, 4, 5, 6])
コード例 #8
0
ファイル: test_sum.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertEqual(sources.flatMap().sum(), 21)
コード例 #9
0
 def test_flatMap(self):
     self.assertListEqual(sources.flatMap().chunk(4).to_list(),
                          [[1, 2, 3, 4], [5, 6]])
コード例 #10
0
 def test_flatMap(self):
     self.assertFalse(sources.flatMap().all_matches(lambda k: k - 2 == 0))
コード例 #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})
コード例 #12
0
ファイル: test_for_each.py プロジェクト: Degubi/Py-Seq
 def test_flatMap(self):
     self.assertListEqual(forEachOpHelper(sources.flatMap()),
                          [1, 2, 3, 4, 5, 6])