def test_mixture_of_mixtures(self):
    self.add_task('task_a', self.function_source)
    self.add_task('task_b', self.function_source)
    self.add_task('task_c', self.function_source)
    MixtureRegistry.add('another_mix', [('task_a', 1), ('task_b', 1)])
    MixtureRegistry.add('supermix', [('another_mix', 1), ('task_c', 1)])
    supermix = MixtureRegistry.get('supermix')
    names = [task.name for task in supermix.tasks]
    self.assertEqual(names, ['task_a', 'task_b', 'task_c'])
    self.assertEqual([supermix.get_rate(t) for t in supermix.tasks], [0.5, 0.5, 1])
def test_mixture_of_mixtures(self):
    self.add_task('task_a', self.function_source)
    self.add_task('task_b', self.function_source)
    self.add_task('task_c', self.function_source)
    MixtureRegistry.add('another_mix', [('task_a', 1), ('task_b', 1)])
    MixtureRegistry.add('supermix', [('another_mix', 1), ('task_c', 1)])
    supermix = MixtureRegistry.get('supermix')
    names = [task.name for task in supermix.tasks]
    self.assertEqual(names, ['task_a', 'task_b', 'task_c'])
    self.assertEqual([supermix.get_rate(t) for t in supermix.tasks], [0.5, 0.5, 1])