def METHOD_NAME(self):
    """
    L{ensureDeferred} allows a function to C{await} on a L{Deferred}.
    """
    async def run():
        d = succeed("foo")
        res = await d
        return res
    d = ensureDeferred(run())
    res = self.successResultOf(d)
    self.assertEqual(res, "foo")