def test_parallel_with_weights_and_minimum(self):
    """Test of the parallel ccmbinator with weights and minimum."""
    dataset1 = lambda: (i for i in range(10))
    dataset2 = lambda: (i for i in range(10, 110))
    parallel = data.Parallel([dataset1, dataset2],
                             counters=(10, 100),
                             reweight_by_minimum=True)
    generator = parallel()

    self.assertEqual(next(generator), 0)
    self.assertEqual(next(generator), 10)
    self.assertEqual(next(generator), 11)
    self.assertEqual(next(generator), 12)
    self.assertEqual(next(generator), 13)
    self.assertEqual(next(generator), 14)
    self.assertEqual(next(generator), 15)
    self.assertEqual(next(generator), 16)
    self.assertEqual(next(generator), 17)
    self.assertEqual(next(generator), 18)
    self.assertEqual(next(generator), 19)
    self.assertEqual(next(generator), 1)
    self.assertEqual(next(generator), 20)
    self.assertEqual(next(generator), 21)
    self.assertEqual(next(generator), 22)
    self.assertEqual(next(generator), 23)
    self.assertEqual(next(generator), 24)
    self.assertEqual(next(generator), 25)
    self.assertEqual(next(generator), 26)
    self.assertEqual(next(generator), 27)
    self.assertEqual(next(generator), 28)
    self.assertEqual(next(generator), 29)
    self.assertEqual(next(generator), 2)
Test of the parallel ccmbinator with weights and minimum.
trax/data/inputs_test.py