Пример #1
0
 def test_create_sequence_using_of(self):
     self.assertDictEqual(
         sources.of().to_dictionary(lambda k: k, lambda k: k * 2), {
             0: 0,
             1: 2,
             2: 4,
             3: 6
         })
Пример #2
0
 def test_create_sequence_using_of(self):
     self.assertEqual(sources.of().max(), 3)
Пример #3
0
 def test_create_sequence_using_of(self):
     self.assertTrue(sources.of().any_matches(lambda k: k - k == 0))
Пример #4
0
 def test_create_sequence_using_of(self):
     self.assertEqual(sources.of().average(), 1.5)
Пример #5
0
 def test_create_sequence_using_of(self):
     self.assertTupleEqual(sources.of().statistics(), NumberStatistics(6, 4, 0, 3, 1.5))
Пример #6
0
 def test_create_sequence_using_of(self):
     self.assertListEqual(sources.of().to_list(), [0, 1, 2, 3])
Пример #7
0
 def test_create_sequence_using_of(self):
     self.assertEqual(sources.of().join(), '0123')
Пример #8
0
 def test_create_sequence_using_of(self):
     self.assertListEqual(forEachOpHelper(sources.of()), [0, 1, 2, 3])