summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Šplíchal <psplicha@redhat.com>2012-06-13 11:55:25 +0200
committerPetr Šplíchal <psplicha@redhat.com>2012-06-13 11:55:25 +0200
commit80a93c3534a5c3b3568ffbd118fd02f15fa8eb89 (patch)
treedbf4b0e05354cbcd65b7703d3999c6b7222d49a5
parent7fa6bae4683e0dd014254c4be9f88ba2140572de (diff)
downloadpython-nitrate-80a93c3534a5c3b3568ffbd118fd02f15fa8eb89.zip
python-nitrate-80a93c3534a5c3b3568ffbd118fd02f15fa8eb89.tar.gz
python-nitrate-80a93c3534a5c3b3568ffbd118fd02f15fa8eb89.tar.xz
Don't forget to include errata id when creating a new test run
-rw-r--r--source/api.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/api.py b/source/api.py
index b232e8f..6c1dfb3 100644
--- a/source/api.py
+++ b/source/api.py
@@ -2619,12 +2619,13 @@ class TestRun(Mutable):
hash["product"] = product.id
hash["product_version"] = product.version.id
- # Build
+ # Build & errata
if build is None:
build = "unspecified"
if isinstance(build, basestring):
build = Build(build=build, product=product)
hash["build"] = build.id
+ hash["errata_id"] = errata
# Summary & notes
if summary is None:
@@ -2741,6 +2742,14 @@ class TestRun(Mutable):
self.assertTrue(isinstance(testrun, TestRun))
self.assertEqual(testrun.summary, "Test run")
+ def testCreateOptionalFields(self):
+ """ Create a new test run, including optional fields """
+ testrun = TestRun(
+ summary="Test run", testplan=self.testplan.id, errata=1234)
+ self.assertTrue(isinstance(testrun, TestRun))
+ self.assertEqual(testrun.summary, "Test run")
+ self.assertEqual(testrun.errata, 1234)
+
def testErrata(self):
""" Set, get and change errata """
for errata in [111, 222, 333]: