def test_load_all(self):
    stack1 = stack.Stack(self.ctx, 'stack1', self.tmpl)
    stack1.store()
    stack2 = stack.Stack(self.ctx, 'stack2', self.tmpl)
    stack2.store()
    stacks = list(stack.Stack.load_all(self.ctx))
    self.assertEqual(2, len(stacks))
    stack3 = stack.Stack(self.ctx, 'stack3', self.tmpl, owner_id=stack2.id)
    stack3.store()
    stacks = list(stack.Stack.load_all(self.ctx))
    self.assertEqual(2, len(stacks))
    stacks = list(stack.Stack.load_all(self.ctx, show_nested=True))
    self.assertEqual(3, len(stacks))
    stack1._backup_stack()
    stacks = list(stack.Stack.load_all(self.ctx))
    self.assertEqual(2, len(stacks))
    stacks = list(stack.Stack.load_all(self.ctx, show_nested=True))
    self.assertEqual(3, len(stacks))
def test_load_all(self):
    stack1 = stack.Stack(self.ctx, 'stack1', self.tmpl)
    stack1.store()
    stack2 = stack.Stack(self.ctx, 'stack2', self.tmpl)
    stack2.store()
    stacks = list(stack.Stack.load_all(self.ctx))
    self.assertEqual(2, len(stacks))
    stack3 = stack.Stack(self.ctx, 'stack3', self.tmpl, owner_id=stack2.id)
    stack3.store()
    stacks = list(stack.Stack.load_all(self.ctx))
    self.assertEqual(2, len(stacks))
    stacks = list(stack.Stack.load_all(self.ctx, show_nested=True))
    self.assertEqual(3, len(stacks))
    stack1._backup_stack()
    stacks = list(stack.Stack.load_all(self.ctx))
    self.assertEqual(2, len(stacks))
    stacks = list(stack.Stack.load_all(self.ctx, show_nested=True))
    self.assertEqual(3, len(stacks))