• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tableau / tabcmd / 28973700054

08 Jul 2026 08:32PM UTC coverage: 84.1%. First build
28973700054

Pull #421

github

web-flow
Merge fba951938 into 724811278
Pull Request #421: chore: merge main back to development

170 of 213 new or added lines in 37 files covered. (79.81%)

2396 of 2849 relevant lines covered (84.1%)

0.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.61
/tabcmd/commands/project/create_project_command.py
1
import tableauserverclient as TSC
1✔
2

3
from tabcmd.commands.auth.session import Session
1✔
4
from tabcmd.commands.constants import Errors
1✔
5
from tabcmd.commands.server import Server
1✔
6
from tabcmd.execution.global_options import *
1✔
7
from tabcmd.execution.localize import _
1✔
8
from tabcmd.execution.logger_config import log
1✔
9

10

11
class CreateProjectCommand(Server):
1✔
12
    """
13
    Command to create a project
14
    """
15

16
    name: str = "createproject"
1✔
17
    description: str = _("createproject.short_description")
1✔
18

19
    @staticmethod
1✔
20
    def define_args(create_project_parser):
1✔
21
        args_group = create_project_parser.add_argument_group(title=CreateProjectCommand.name)
1✔
22
        args_group.add_argument(
1✔
23
            "--name", "-n", dest="project_name", required=True, help=_("createproject.options.name")
24
        )
25
        set_parent_project_arg(create_project_parser)
1✔
26
        set_description_arg(create_project_parser)
1✔
27

28
    @classmethod
1✔
29
    def run_command(cls, args):
1✔
30
        logger = log(cls.__name__, args.logging_level)
1✔
31
        logger.debug(_("tabcmd.launching"))
1✔
32
        session = Session()
1✔
33
        server = session.create_session(args, logger)
1✔
34
        parent_id = None
1✔
35
        readable_name = args.project_name
1✔
36
        if args.parent_project_path:
1✔
37
            try:
1✔
38
                logger.debug(_("tabcmd.find.parent_project").format(args.parent_project_path))
1✔
39
                # use none for the readable name because we are just looking for the parent path
40
                parent = Server.get_project_by_name_and_parent_path(logger, server, None, args.parent_project_path)
1✔
41
            except Exception as exc:
×
NEW
42
                Errors.exit_with_error(logger, exception=exc)
×
43
            readable_name = "{0}/{1}".format(args.parent_project_path, args.project_name)
1✔
44
            parent_id = parent.id
1✔
45
            logger.debug("parent project = `{0}`, id = {1}".format(args.parent_project_path, parent_id))
1✔
46
        logger.info(_("createproject.status").format(readable_name))
1✔
47
        new_project = TSC.ProjectItem(args.project_name, args.description, None, parent_id)
1✔
48
        project_item = None
1✔
49
        try:
1✔
50
            project_item = server.projects.create(new_project)
1✔
51
            logger.info(_("common.output.succeeded"))
1✔
52
            return project_item
1✔
53
        except Exception as e:
×
54
            if Errors.is_resource_conflict(e) and args.continue_if_exists:
×
55
                logger.info(_("errors.xmlapi.already_exists").format(_("content_type.project"), args.project_name))
×
56
                logger.info(_("common.output.succeeded"))
×
57
            else:
NEW
58
                Errors.exit_with_error(logger, exception=e)
×
59

60
        return project_item
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc