Beispiel #1
0
import sys
import common_func

from common_func import plan_file_add, plant_issue, plant_check, remove_created_plans

# Check the assign task command
# Test:
# plan add <plan_name>
# task add <task_name>
# task assign 1 resour
# plan show
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
task_name = str(uuid.uuid4())[:23]
check_string = (common_func.table_header() + common_func.create_task_str(
    1, 1, task_name, "P", 0, "   0:00:00", 0, " resour"))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_issue([plan_app, "task", "assign", "1", "resour"])
plant_check([plan_app, "plan", "show"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #2
0
#!/usr/bin/python
import os
import uuid
import subprocess
import sys

from common_func import plan_file_add, plant_issue, plant_check, remove_created_plans

# Check the complete task command with wrong id
# Test:
# plan add <plan_name>
# project add <project_name>
# task complete <wrong_id>
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
project_name = str(uuid.uuid4())[:23]
check_string = ("There is no item with the requested id.\n")

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "project", "add", project_name])
plant_check([plan_app, "task", "complete", "1"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #3
0
# Test:
# plan add <plan_name>
# task add <task_name>
# task start 1
# sleep 5
# task stop 1
# plan show
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
task_name = str(uuid.uuid4())[:23]
check_string = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 0, "   0:00:05", 0, "") +
    "DONT CHECK\n" + "DONT CHECK\n")

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_issue([plan_app, "task", "start", "1"])
time.sleep(5)
plant_issue([plan_app, "task", "stop", "1"])
plant_check([plan_app, "plan", "show"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #4
0
task_name32 = str(uuid.uuid4())[:23]
project_name33 = str(uuid.uuid4())[:23]
project_name331 = str(uuid.uuid4())[:23]
project_name332 = str(uuid.uuid4())[:23]
task_name333 = str(uuid.uuid4())[:23]
project_name34 = str(uuid.uuid4())[:23]
task_name35 = str(uuid.uuid4())[:23]
task_name4 = str(uuid.uuid4())[:23]
project_name5 = str(uuid.uuid4())[:23]
project_name51 = str(uuid.uuid4())[:23]
project_name6 = str(uuid.uuid4())[:23]
task_name61 = str(uuid.uuid4())[:23]
check_string = (common_func.table_header() + "There is no such id to show.\n")

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name1])
plant_issue([plan_app, "project", "add", project_name2])
plant_issue([plan_app, "project", "add", project_name3])
plant_issue([plan_app, "task", "add", task_name4])
plant_issue([plan_app, "project", "add", project_name5])
plant_issue([plan_app, "project", "add", project_name31, "3"])
plant_issue([plan_app, "task", "add", task_name32, "3"])
plant_issue([plan_app, "project", "add", project_name33, "3"])
plant_issue([plan_app, "project", "add", project_name6])
plant_issue([plan_app, "project", "add", project_name34, "3"])
plant_issue([plan_app, "task", "add", task_name35, "3"])
plant_issue([plan_app, "task", "add", task_name21, "2"])
plant_issue([plan_app, "project", "add", project_name22, "2"])
plant_issue([plan_app, "project", "add", project_name23, "2"])
plant_issue([plan_app, "project", "add", project_name24, "2"])
Beispiel #5
0
#!/usr/bin/python
import os
import uuid
import subprocess
import sys

from common_func import plan_file_add, plant_issue, plant_check, remove_created_plans

# Check the suspend task command with wrong id
# Test:
# plan add <plan_name>
# task suspend <wrong_id>
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
check_string = ("There is no item with the requested id.\n")

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_check([plan_app, "task", "suspend", "1"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #6
0
        common_func.table_header() +
        common_func.create_project_str(1, 1, project_name1, 0, 0) +
        common_func.create_project_str(2, 1, project_name2, 3, 3) +
        common_func.create_project_str(3, 2, project_name21, 0, 0) +
        common_func.create_project_str(4, 2, project_name22, 3, 3) +
        common_func.create_project_str(5, 3, project_name221, 2, 2) +
        common_func.create_project_str(6, 4, project_name2211, 0, 0) +
        common_func.create_project_str(7, 4, project_name2212, 0, 0) +
        common_func.create_project_str(8, 3, project_name222, 0, 0) +
        common_func.create_project_str(9, 3, project_name223, 0, 0) +
        common_func.create_project_str(10, 2, project_name23, 0, 0) +
        common_func.create_project_str(11, 1, project_name3, 0, 0)
        )

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "project", "add", project_name1])
plant_issue([plan_app, "project", "add", project_name2])
plant_issue([plan_app, "project", "add", project_name3])
plant_issue([plan_app, "project", "add", project_name21, "2"])
plant_issue([plan_app, "project", "add", project_name22, "2"])
plant_issue([plan_app, "project", "add", project_name23, "2"])
plant_issue([plan_app, "project", "add", project_name221, "4"])
plant_issue([plan_app, "project", "add", project_name222, "4"])
plant_issue([plan_app, "project", "add", project_name223, "4"])
plant_issue([plan_app, "project", "add", project_name2211, "5"])
plant_issue([plan_app, "project", "add", project_name2212, "5"])
plant_check([plan_app, "project", "show", "0"], check_string)

# Remove plan files
remove_created_plans()
Beispiel #7
0
#!/usr/bin/python
import os
import uuid
import subprocess
import sys

from common_func import plan_file_add, plant_issue, plant_check, remove_created_plans

# Check the complete task command with wrong id
# Test:
# plan add <plan_name>
# task add <task_name>
# task complete 10
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
task_name = str(uuid.uuid4())[:23]
check_string = ("There is no item with the requested id.\n")

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_check([plan_app, "task", "complete", "10"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #8
0
# plan add <plan_name>
# task add <task_name>
# task active 1
# task suspend 1
# plan show
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
task_name = str(uuid.uuid4())[:23]
check_string1 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "A", 0, "   0:00:00", 0, ""))
check_string2 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 0, "   0:00:00", 0, ""))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_issue([plan_app, "task", "active", "1"])
plant_check([plan_app, "plan", "show"], check_string1)
plant_issue([plan_app, "task", "suspend", "1"])
plant_check([plan_app, "plan", "show"], check_string2)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #9
0
plan_file_add(plan_name)
task_name = str(uuid.uuid4())[:23]
check_string1 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 50, "   0:00:00", 0, ""))
check_string2 = (common_func.table_header() + common_func.create_task_str(
    1, 1, task_name, "C", 100, "   0:00:00", 0, ""))
check_string3 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 30, "   0:00:00", 0, ""))
check_string4 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 0, "   0:00:00", 0, ""))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_issue([plan_app, "task", "progress", "1", "50"])
plant_check([plan_app, "plan", "show"], check_string1)
plant_issue([plan_app, "task", "progress", "1", "100"])
plant_check([plan_app, "plan", "show"], check_string2)
plant_issue([plan_app, "task", "progress", "1", "30"])
plant_check([plan_app, "plan", "show"], check_string3)
plant_issue([plan_app, "task", "progress", "1", "0"])
plant_check([plan_app, "plan", "show"], check_string4)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #10
0
import sys
import common_func

from common_func import plan_file_add, plant_issue, plant_check, remove_created_plans

# Check the complete task command
# Test:
# plan add <plan_name>
# task add <task_name>
# task complete 1
# plan show
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
task_name = str(uuid.uuid4())[:23]
check_string = (common_func.table_header() + common_func.create_task_str(
    1, 1, task_name, "C", 100, "   0:00:00", 0, ""))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_issue([plan_app, "task", "complete", "1"])
plant_check([plan_app, "plan", "show"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #11
0
    "     |        extra hours (not tracked):   15h  |   |      |            |        |\n"
)
check_string3 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 0, "   0:00:00", 0, ""))
check_string4 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 0, "   2:00:00", 0, "") +
    "     |        extra hours (not tracked):    2h  |   |      |            |        |\n"
)
check_string5 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name, "P", 0, "   0:00:00", 0, ""))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_issue([plan_app, "task", "track", "1", "10"])
plant_check([plan_app, "plan", "show"], check_string1)
plant_issue([plan_app, "task", "track", "1", "5"])
plant_check([plan_app, "plan", "show"], check_string2)
plant_issue([plan_app, "task", "track", "1", "-15"])
plant_check([plan_app, "plan", "show"], check_string3)
plant_issue([plan_app, "task", "track", "1", "2"])
plant_check([plan_app, "plan", "show"], check_string4)
plant_issue([plan_app, "task", "track", "1", "-20"])
plant_check([plan_app, "plan", "show"], check_string5)

# Remove plan files
remove_created_plans()
Beispiel #12
0
                common_func.create_project_str(2, 2, project_name11, 0, 0) +
                common_func.create_project_str(3, 2, project_name12, 0, 0) +
                common_func.create_project_str(4, 2, project_name13, 0, 0) +
                common_func.create_project_str(5, 1, project_name2, 3, 3) +
                common_func.create_project_str(6, 2, project_name21, 0, 0) +
                common_func.create_project_str(7, 2, project_name22, 2, 2) +
                common_func.create_project_str(8, 3, project_name221, 0, 0) +
                common_func.create_project_str(9, 3, project_name222, 0, 0) +
                common_func.create_project_str(10, 2, project_name23, 0, 0) +
                common_func.create_project_str(11, 1, project_name3, 1, 1) +
                common_func.create_project_str(12, 2, project_name31, 0, 0) +
                common_func.create_project_str(13, 1, project_name4, 1, 1) +
                common_func.create_project_str(14, 2, project_name41, 0, 0))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "project", "add", project_name1])
plant_issue([plan_app, "project", "add", project_name2])
plant_issue([plan_app, "project", "add", project_name3])
plant_issue([plan_app, "project", "add", project_name21, "2"])
plant_issue([plan_app, "project", "add", project_name22, "2"])
plant_issue([plan_app, "project", "add", project_name4])
plant_issue([plan_app, "project", "add", project_name23, "2"])
plant_issue([plan_app, "project", "add", project_name11, "1"])
plant_issue([plan_app, "project", "add", project_name12, "1"])
plant_issue([plan_app, "project", "add", project_name13, "1"])
plant_issue([plan_app, "project", "add", project_name221, "7"])
plant_issue([plan_app, "project", "add", project_name222, "7"])
plant_issue([plan_app, "project", "add", project_name31, "11"])
plant_issue([plan_app, "project", "add", project_name41, "13"])
plant_check([plan_app, "plan", "show"], check_string)
Beispiel #13
0
import sys

from common_func import plan_file_add, plant_issue, plant_check, remove_created_plans

# Check the current plan command after switch
# Test:
# plan add <plan_name1>
# plan add <plan_name2>
# plan switch <plan_name1>
# plan current
# <check output, plan_name1>

# Define main variables
plan_app = sys.argv[1] + "/../build/plant"
plan_name1 = str(uuid.uuid4())
plan_file_add(plan_name1)
plan_name2 = str(uuid.uuid4())
plan_file_add(plan_name2)
check_string = ("Plan: \"" + plan_name1 + "\"\n")

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name1])
plant_issue([plan_app, "plan", "add", plan_name2])
plant_issue([plan_app, "plan", "switch", plan_name1])
plant_check([plan_app, "plan", "current"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #14
0
# Test:
# plan add <plan_name>
# task add <task_name1>
# task rename 1 <task_name2>
# plan show
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
task_name1 = str(uuid.uuid4())[:23]
task_name2 = str(uuid.uuid4())[:23]
check_string1 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name1, "P", 0, "   0:00:00", 0, ""))
check_string2 = (
    common_func.table_header() +
    common_func.create_task_str(1, 1, task_name2, "P", 0, "   0:00:00", 0, ""))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name1])
plant_check([plan_app, "plan", "show"], check_string1)
plant_issue([plan_app, "task", "rename", "1", task_name2])
plant_check([plan_app, "plan", "show"], check_string2)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #15
0
from common_func import plan_file_add, plant_issue, plant_check, remove_created_plans

# Check the estimate task command
# Test:
# plan add <plan_name>
# task add <task_name>
# task estimate 1 8
# plan show
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
task_name = str(uuid.uuid4())[:23]
check_string = (
        common_func.table_header() +
        common_func.create_task_str(1, 1, task_name, "P", 0, "   0:00:00", 8, "")
        )

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "task", "add", task_name])
plant_issue([plan_app, "task", "estimate", "1", "8"])
plant_check([plan_app, "plan", "show"], check_string)

# Remove plan files
remove_created_plans()

sys.exit(0)
Beispiel #16
0
# Check the rename project command
# Test:
# plan add <plan_name>
# project add <project_name1>
# project rename 1 <project_name2>
# plan show
# <check output>

plan_app = sys.argv[1] + "/../build/plant"
plan_name = str(uuid.uuid4())
plan_file_add(plan_name)
project_name1 = str(uuid.uuid4())[:23]
project_name2 = str(uuid.uuid4())[:23]
check_string1 = (common_func.table_header() +
                 common_func.create_project_str(1, 1, project_name1, 0, 0))
check_string2 = (common_func.table_header() +
                 common_func.create_project_str(1, 1, project_name2, 0, 0))

# Run all the process and check output
plant_issue([plan_app, "plan", "add", plan_name])
plant_issue([plan_app, "project", "add", project_name1])
plant_check([plan_app, "plan", "show"], check_string1)
plant_issue([plan_app, "project", "rename", "1", project_name2])
plant_check([plan_app, "plan", "show"], check_string2)

# Remove plan files
remove_created_plans()

sys.exit(0)