summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Šplíchal <psplicha@redhat.com>2012-07-27 16:50:08 +0200
committerPetr Šplíchal <psplicha@redhat.com>2012-07-27 16:50:08 +0200
commita62ebb5d8d6634e175044bafb2433eef3b19cbe1 (patch)
treeb14f7ff4a27afe37c6fcf0a9b3680afea41b0d72
parentb562ffc9c7ed5ce63a55c182d74783360bbeef60 (diff)
downloadpython-nitrate-experimental.zip
python-nitrate-experimental.tar.gz
python-nitrate-experimental.tar.xz
New TestCase reference link field [BZ#843382]experimentaldevel
-rw-r--r--source/api.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/api.py b/source/api.py
index 708aad3..558fac1 100644
--- a/source/api.py
+++ b/source/api.py
@@ -2825,6 +2825,8 @@ class TestCase(Mutable):
doc="Test script arguments (used for automation).")
category = property(_getter("category"), _setter("category"),
doc="Test case category.")
+ link = property(_getter("link"), _setter("link"),
+ doc="Test case reference link.")
manual = property(_getter("manual"), _setter("manual"),
doc="Manual flag. True if the test case is manual.")
notes = property(_getter("notes"), _setter("notes"),
@@ -2870,8 +2872,9 @@ class TestCase(Mutable):
# Prepare attributes, check test case hash, initialize
self._attributes = """arguments author automated autoproposed bugs
- category components manual notes plans priority product script
- sortkey status summary tags tester testplans time""".split()
+ category components link manual notes plans priority product
+ script sortkey status summary tags tester testplans
+ time""".split()
testcasehash = kwargs.get("testcasehash")
if testcasehash:
id = testcasehash["case_id"]
@@ -3001,6 +3004,7 @@ class TestCase(Mutable):
self._arguments = testcasehash["arguments"]
self._author = User(testcasehash["author_id"])
self._category = Category(testcasehash["category_id"])
+ self._link = testcasehash["extra_link"]
self._notes = testcasehash["notes"]
self._priority = Priority(testcasehash["priority_id"])
self._requirement = testcasehash["requirement"]
@@ -3046,6 +3050,7 @@ class TestCase(Mutable):
else:
hash["is_automated"] = 0
hash["is_automated_proposed"] = self.autoproposed
+ hash["extra_link"] = self.link
hash["notes"] = self.notes
hash["priority"] = self.priority.id
hash["product"] = self.category.product.id
@@ -3119,6 +3124,15 @@ class TestCase(Mutable):
""" Fetch an existing test case by id (invalid id) """
self.assertRaises(NitrateError, TestCase, 'invalid-id')
+ def testReferenceLink(self):
+ """ Fetch and update test case reference link """
+ for url in ["http://first.host.com/", "http://second.host.com/"]:
+ testcase = TestCase(self.testcase.id)
+ testcase.link = url
+ testcase.update()
+ testcase = TestCase(self.testcase.id)
+ self.assertEqual(testcase.link, url)
+
def testAutomationFlags(self):
""" Check automated, autoproposed and manual flags """
# Both automated and manual