MCPcopy
hub / github.com/jisaacks/GitGutter / test_chain_with_resolved

Method test_chain_with_resolved

tests/test_promise.py:22–32  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20 # Tests are using private methods of Promise on purpose.
21
22 def test_chain_with_resolved(self):
23 def worker(resolve_fn):
24 resolve_fn(999)
25
26 def assertResult(result):
27 self.assertEqual(result, 999)
28
29 promise = Promise(worker)
30 self.assertTrue(promise._is_resolved())
31 promise2 = promise.then(assertResult)
32 self.assertTrue(promise2._is_resolved())
33
34 def test_chain_with_pending(self):
35 def worker_async(resolve_fn):

Callers

nothing calls this directly

Calls 3

_is_resolvedMethod · 0.95
thenMethod · 0.95
PromiseClass · 0.90

Tested by

no test coverage detected