From 1ca0f0cfe4a436c49a6ffd7c3d11881cfd3f9f18 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Fri, 19 Aug 2011 19:52:03 +0200 Subject: Display test_cases info from Bodhi --- fedora-easy-karma.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fedora-easy-karma.py b/fedora-easy-karma.py index d3de40b..4ce9052 100755 --- a/fedora-easy-karma.py +++ b/fedora-easy-karma.py @@ -47,7 +47,7 @@ from fedora.client.bodhi import BodhiClient class FEK_helper(object): @staticmethod - def bodhi_update_str(update, bodhi_base_url="https://admin.fedoraproject.org/updates/", bugzilla_bug_url="https://bugzilla.redhat.com/", wrap_bugs=True, width=80): + def bodhi_update_str(update, bodhi_base_url="https://admin.fedoraproject.org/updates/", bugzilla_bug_url="https://bugzilla.redhat.com/", test_cases_url="https://fedoraproject.org/wiki/", wrap_bugs=True, width=80): # copy update to avoid side effects values = dict(update) @@ -62,6 +62,7 @@ class FEK_helper(object): " Karma: %(karma)d\n" "%(request)s" "%(bugs)s" + "%(test_cases)s" "%(notes)s" " Submitter: %(submitter)s\n" " Submitted: %(date_submitted)s\n" @@ -100,6 +101,12 @@ class FEK_helper(object): else: values["bugs"] = "" + if update["nagged"] and "test_cases" in update["nagged"]: + test_cases = ["%s%s" % (test_cases_url, t.replace(" ", "_").replace(":", "%3A")) for t in update["nagged"]["test_cases"]] + values["test_cases"] = "%s\n" % FEK_helper.wrap_paragraphs_prefix(test_cases, first_prefix=" Test Cases: ", width=width, extra_newline=True) + else: + values["test_cases"] = "" + if update["notes"]: values["notes"] = "%s\n" % FEK_helper.wrap_paragraphs_prefix(update["notes"].split("\r\n"), first_prefix=" Notes: ", width=width) else: -- cgit