def test_get_rate_with_callable(self):

    def fn(t):
        self.assertEqual(t.name, 'task4')
        return 42
    self.add_task('task4', self.function_source)
    task = TaskRegistry.get('task4')
    MixtureRegistry.add('test_mix5', [('task4', fn)])
    mix = MixtureRegistry.get('test_mix5')
    self.assertEqual(mix.get_rate(task), 42)
def test_get_rate_with_callable(self):

    def fn(t):
        self.assertEqual(t.name, 'task4')
        return 42
    self.add_task('task4', self.function_source)
    task = TaskRegistry.get('task4')
    MixtureRegistry.add('test_mix5', [('task4', fn)])
    mix = MixtureRegistry.get('test_mix5')
    self.assertEqual(mix.get_rate(task), 42)