arch-insight-cli 0.4.1__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/PKG-INFO +1 -1
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_cli/__init__.py +1 -1
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_cli/main.py +17 -1
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/PKG-INFO +1 -1
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/pyproject.toml +1 -1
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/tests/test_work.py +13 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/README.md +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_cli/auth.py +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_cli/comms.py +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_cli/work.py +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/SOURCES.txt +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/dependency_links.txt +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/entry_points.txt +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/requires.txt +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/top_level.txt +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/setup.cfg +0 -0
- {arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/tests/test_comms.py +0 -0
|
@@ -478,13 +478,23 @@ def document_create(args):
|
|
|
478
478
|
def task_update(args):
|
|
479
479
|
body = {k: v for k, v in (("status", args.status), ("priority", args.priority),
|
|
480
480
|
("due_date", args.due_date), ("title", args.title)) if v is not None}
|
|
481
|
+
if args.description_file:
|
|
482
|
+
body["description"] = comms.read_text(args.description_file)
|
|
483
|
+
elif args.description is not None:
|
|
484
|
+
body["description"] = args.description
|
|
481
485
|
if args.assignee:
|
|
482
486
|
body["assignees"] = args.assignee
|
|
483
487
|
if not body:
|
|
484
|
-
raise CliError("Nothing to change: pass --status, --assignee, --due-date, --priority
|
|
488
|
+
raise CliError("Nothing to change: pass --status, --assignee, --due-date, --priority, "
|
|
489
|
+
"--title or --description.")
|
|
485
490
|
emit(request(args, "PUT", f"/api/agile/tasks/{args.task_id}", body))
|
|
486
491
|
|
|
487
492
|
|
|
493
|
+
def task_delete(args):
|
|
494
|
+
request(args, "DELETE", f"/api/agile/tasks/{args.task_id}")
|
|
495
|
+
emit({"deleted": args.task_id})
|
|
496
|
+
|
|
497
|
+
|
|
488
498
|
def ticket_list(args):
|
|
489
499
|
page = request(args, "GET", "/api/tickets")
|
|
490
500
|
emit([{k: r.get(k) for k in ("id", "title", "status", "priority", "due_date")}
|
|
@@ -690,7 +700,13 @@ def build_parser():
|
|
|
690
700
|
tu.add_argument("--due-date")
|
|
691
701
|
tu.add_argument("--title")
|
|
692
702
|
tu.add_argument("--assignee", action="append")
|
|
703
|
+
tu.add_argument("--description")
|
|
704
|
+
tu.add_argument("--description-file")
|
|
693
705
|
tu.set_defaults(func=task_update)
|
|
706
|
+
td = [a for a in areas.choices["task"]._subparsers._group_actions][0].add_parser(
|
|
707
|
+
"delete", help="Delete a task")
|
|
708
|
+
td.add_argument("task_id", type=int)
|
|
709
|
+
td.set_defaults(func=task_delete)
|
|
694
710
|
return parser
|
|
695
711
|
|
|
696
712
|
|
|
@@ -127,3 +127,16 @@ def test_org_show_leaves_out_billing_identifiers(monkeypatch):
|
|
|
127
127
|
text = str(shown[0])
|
|
128
128
|
assert "cus_1" not in text and "tok" not in text and "'J'" not in text
|
|
129
129
|
assert shown[0]["members"] == [{"name": "a", "email": "a@x", "roles": ["Admin"]}]
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def test_task_description_and_delete(monkeypatch, tmp_path):
|
|
133
|
+
sent = []
|
|
134
|
+
monkeypatch.setattr(main, "request", lambda args, method, path, body=None, **kw: sent.append((method, path, body)) or {})
|
|
135
|
+
monkeypatch.setattr(main, "emit", lambda value: None)
|
|
136
|
+
f = tmp_path / "d.md"
|
|
137
|
+
f.write_text("line one\n- detail", encoding="utf-8")
|
|
138
|
+
for argv in (["task", "update", "5", "--description-file", str(f)], ["task", "delete", "6"]):
|
|
139
|
+
args = main.build_parser().parse_args(argv)
|
|
140
|
+
args.func(args)
|
|
141
|
+
assert sent == [("PUT", "/api/agile/tasks/5", {"description": "line one\n- detail"}),
|
|
142
|
+
("DELETE", "/api/agile/tasks/6", None)]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{arch_insight_cli-0.4.1 → arch_insight_cli-0.4.2}/arch_insight_cli.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|