def METHOD_NAME(self, dbMethodName, method, exp_args=None,
                        exp_kwargs=None, *args, **kwargs):
    rv = (1, 2)
    m = mock.Mock(return_value=defer.succeed(rv))
    setattr(self.master.db.builds, dbMethodName, m)
    res = yield method(*args, **kwargs)
    self.assertIdentical(res, rv)
    m.assert_called_with(
        *(exp_args or args), **((exp_kwargs is None) and kwargs or exp_kwargs))