def test_tasks(self):
    self.add_task('task1', self.function_source)
    self.add_task('task2', self.function_source)
    MixtureRegistry.add('test_mix1', [('task1', 1), ('task2', 1)])
    mix = MixtureRegistry.get('test_mix1')
    self.assertEqual(len(mix.tasks), 2)
    for task in mix.tasks:
        self.verify_task_matches_fake_datasets(task.name, use_cached=False)
        self.assertEqual(mix.get_rate(task), 1)
def test_tasks(self):
    self.add_task('task1', self.function_source)
    self.add_task('task2', self.function_source)
    MixtureRegistry.add('test_mix1', [('task1', 1), ('task2', 1)])
    mix = MixtureRegistry.get('test_mix1')
    self.assertEqual(len(mix.tasks), 2)
    for task in mix.tasks:
        self.verify_task_matches_fake_datasets(task.name, use_cached=False)
        self.assertEqual(mix.get_rate(task), 1)