Exemplo n.º 1
0
 def test_filter(self):
     self.assertDictEqual(
         sources.filter().to_dictionary(lambda k: k, lambda k: k), {
             0: 0,
             2: 2,
             4: 4
         })
Exemplo n.º 2
0
 def test_filter(self):
     self.assertEqual(sources.filter().max(), 4)
Exemplo n.º 3
0
 def test_filter(self):
     self.assertEqual(sources.filter().first(), 0)
Exemplo n.º 4
0
 def test_filter(self):
     self.assertTrue(sources.filter().any_matches(lambda k: k % 2 == 0))
Exemplo n.º 5
0
 def test_filter(self):
     self.assertEqual(sources.filter().average(), 2)
Exemplo n.º 6
0
 def test_filter(self):
     self.assertTupleEqual(sources.filter().statistics(), NumberStatistics(6, 3, 0, 4, 2))
Exemplo n.º 7
0
 def test_filter(self):
     self.assertListEqual(sources.filter().to_list(), [0, 2, 4])
Exemplo n.º 8
0
 def test_filter(self):
     self.assertEqual(sources.filter().join(', '), '0, 2, 4')
Exemplo n.º 9
0
 def test_filter(self):
     self.assertEqual(sources.filter().sum(), 6)
Exemplo n.º 10
0
 def test_filter(self):
     self.assertListEqual(sources.filter().chunk(2).to_list(),
                          [[0, 2], [4]])
Exemplo n.º 11
0
 def test_filter(self):
     self.assertListEqual(forEachOpHelper(sources.filter()), [0, 2, 4])
Exemplo n.º 12
0
 def test_filter(self):
     self.assertEqual(sources.filter().count(), 3)