def test_kwargs(self):
    tmpl = template.Template(copy.deepcopy(empty_template))
    ctx = utils.dummy_context()
    test_data = dict(action='x', status='y', status_reason='z', timeout_mins=33, disable_rollback=True, parent_resource='fred', owner_id=32, stack_user_project_id=569, user_creds_id=123, tenant_id='some-uuid', username='jo', nested_depth=3, strict_validate=True, convergence=False, current_traversal=45, tags=['tag1', 'tag2'])
    db_map = {'parent_resource': 'parent_resource_name', 'tenant_id': 'tenant', 'timeout_mins': 'timeout'}
    test_db_data = {}
    for key in test_data:
        dbkey = db_map.get(key, key)
        test_db_data[dbkey] = test_data[key]
    self.stack = stack.Stack(ctx, utils.random_name(), tmpl, **test_data)
    res = self.stack.get_kwargs_for_cloning(keep_status=self.keep_status, only_db=self.only_db, keep_tags=self.keep_tags)
    for key in self.not_included:
        self.assertNotIn(key, res)
    for key in test_data:
        if (key not in self.not_included):
            dbkey = db_map.get(key, key)
            if self.only_db:
                self.assertEqual(test_data[key], res[dbkey])
            else:
                self.assertEqual(test_data[key], res[key])
    if (not self.only_db):
        stack.Stack(ctx, utils.random_name(), tmpl, **res)
def test_kwargs(self):
    tmpl = template.Template(copy.deepcopy(empty_template))
    ctx = utils.dummy_context()
    test_data = dict(action='x', status='y', status_reason='z', timeout_mins=33, disable_rollback=True, parent_resource='fred', owner_id=32, stack_user_project_id=569, user_creds_id=123, tenant_id='some-uuid', username='jo', nested_depth=3, strict_validate=True, convergence=False, current_traversal=45, tags=['tag1', 'tag2'])
    db_map = {'parent_resource': 'parent_resource_name', 'tenant_id': 'tenant', 'timeout_mins': 'timeout'}
    test_db_data = {}
    for key in test_data:
        dbkey = db_map.get(key, key)
        test_db_data[dbkey] = test_data[key]
    self.stack = stack.Stack(ctx, utils.random_name(), tmpl, **test_data)
    res = self.stack.get_kwargs_for_cloning(keep_status=self.keep_status, only_db=self.only_db, keep_tags=self.keep_tags)
    for key in self.not_included:
        self.assertNotIn(key, res)
    for key in test_data:
        if (key not in self.not_included):
            dbkey = db_map.get(key, key)
            if self.only_db:
                self.assertEqual(test_data[key], res[dbkey])
            else:
                self.assertEqual(test_data[key], res[key])
    if (not self.only_db):
        stack.Stack(ctx, utils.random_name(), tmpl, **res)