Esempio n. 1
0
 def test_cli_task_find_with_project_name_exists(self):
     project_identifier = "test_cli_task_find_with_project_name_exists"
     project_create(project_identifier)
     task_number = "1"
     task_create(project_identifier, task_number)
     runner = CliRunner()
     result = runner.invoke(cli_task_find,
                            [project_identifier, task_number])
     self.assertIsNone(result.exception)
     self.assertIn(
         "Found task with project {0} and task number {1}".format(
             project_identifier, task_number), result.output)
Esempio n. 2
0
 def test_cli_task_update_by_project_name_exists(self):
     project_identifier = "test_cli_task_update_by_project_name_exists"
     project_create(project_identifier)
     task_number = "1"
     task_create(project_identifier, task_number)
     runner = CliRunner()
     result = runner.invoke(cli_task_update,
                            [project_identifier, task_number])
     self.assertIsNone(result.exception)
     self.assertIn(
         "Successfuly updated task number: {0} of project: {1}".format(
             task_number, project_identifier), result.output)
Esempio n. 3
0
 def test_cli_task_update_by_project_id_exists(self):
     project = project_create("test_cli_task_update_by_project_id_exists")
     project_identifier = str(project.id)
     task_number = "1"
     task_create(project.project_name, task_number)
     runner = CliRunner()
     result = runner.invoke(
         cli_task_update,
         ["--identifier_type", "id", "--", project_identifier, task_number])
     self.assertIsNone(result.exception)
     self.assertIn(
         "Successfuly updated task number: {0} of project: {1}".format(
             task_number, project_identifier), result.output)
Esempio n. 4
0
 def test_cli_task_find_with_project_id_exists(self):
     project = project_create("test_cli_task_find_with_project_id_exists")
     project_identifier = str(project.id)
     task_number = "1"
     task_create(project.id, task_number)
     runner = CliRunner()
     result = runner.invoke(
         cli_task_find,
         ["--identifier_type", "id", "--", project_identifier, task_number])
     self.assertIsNone(result.exception)
     self.assertIn(
         "Found task with project {0} and task number {1}".format(
             project_identifier, task_number), result.output)
Esempio n. 5
0
 def test_cli_task_update_reset_user(self):
     user = user_create("A10", "Kathir")
     project_identifier = "test_cli_task_update_reset_user"
     project_create(project_identifier)
     task_number = "1"
     task_create(project_identifier, task_number)
     task = task_update(project_identifier, task_number, user=user)
     self.assertIsNotNone(task.user)
     runner = CliRunner()
     result = runner.invoke(
         cli_task_update,
         [project_identifier, task_number, "--user_external_id", ""])
     self.assertIsNone(result.exception)
     self.assertIn(
         "Successfuly updated task number: {0} of project: {1}".format(
             task_number, project_identifier), result.output)
     task_after_update = task_find(project_identifier, task_number)
     self.assertIsNone(task_after_update.user)