def test_iterdeps(self):
    x = self.app.AsyncResult('1')
    x.backend._cache['1'] = {'status': states.SUCCESS, 'result': None}
    c = [EagerResult(str(i), i, states.SUCCESS) for i in range(3)]
    for child in c:
        child.backend = Mock()
        child.backend.get_children.return_value = []
    x.backend.get_children = Mock()
    x.backend.get_children.return_value = c
    it = x.iterdeps()
    self.assertListEqual(list(it), [(None, x), (x, c[0]), (x, c[1]), (x, c[2])])
    x.backend._cache.pop('1')
    x.ready = Mock()
    x.ready.return_value = False
    with self.assertRaises(IncompleteStream):
        list(x.iterdeps())
    list(x.iterdeps(intermediate=True))
def test_iterdeps(self):
    x = self.app.AsyncResult('1')
    x.backend._cache['1'] = {'status': states.SUCCESS, 'result': None}
    c = [EagerResult(str(i), i, states.SUCCESS) for i in range(3)]
    for child in c:
        child.backend = Mock()
        child.backend.get_children.return_value = []
    x.backend.get_children = Mock()
    x.backend.get_children.return_value = c
    it = x.iterdeps()
    self.assertListEqual(list(it), [(None, x), (x, c[0]), (x, c[1]), (x, c[2])])
    x.backend._cache.pop('1')
    x.ready = Mock()
    x.ready.return_value = False
    with self.assertRaises(IncompleteStream):
        list(x.iterdeps())
    list(x.iterdeps(intermediate=True))