def test_when_other(self): m = Mock() p = maybe_promise(m) assert isinstance(p, Thenable)
def test_when_none(self): assert maybe_promise(None) is None
def test_when_promise(self): p = promise() assert maybe_promise(p) is p
def test_when_promise(self): p = promise() self.assertIs(maybe_promise(p), p)
def test_when_none(self): self.assertIsNone(maybe_promise(None))