summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Šplíchal <psplicha@redhat.com>2011-11-03 15:57:53 +0100
committerPetr Šplíchal <psplicha@redhat.com>2011-11-03 16:06:07 +0100
commit5721574555aa4125bd690c433ab167e5ea8d7a5b (patch)
tree326fde1c542b12b8ee352227e0dbad63ae8c5ab1
parent5a0099ec5f6f2ca2f1383b70325bd528817cd061 (diff)
downloadpython-nitrate-5721574555aa4125bd690c433ab167e5ea8d7a5b.zip
python-nitrate-5721574555aa4125bd690c433ab167e5ea8d7a5b.tar.gz
python-nitrate-5721574555aa4125bd690c433ab167e5ea8d7a5b.tar.xz
Nitrate: Work around BZ#725726 (attempt to fetch test cases by ids)
-rw-r--r--Nitrate.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Nitrate.py b/Nitrate.py
index 63414e9..7ea9f0d 100644
--- a/Nitrate.py
+++ b/Nitrate.py
@@ -91,6 +91,7 @@ import re
import sys
import types
import unittest
+import xmlrpclib
import ConfigParser
import logging as log
from pprint import pformat as pretty
@@ -2580,8 +2581,15 @@ class TestCases(Container):
def _get(self):
""" Fetch currently linked test cases from the server. """
log.info("Fetching {0}'s cases".format(self._identifier))
- self._current = set([TestCase(testcasehash=hash) for hash in
- self._server.TestPlan.get_test_cases(self.id)])
+ try:
+ self._current = set([TestCase(testcasehash=hash) for hash in
+ self._server.TestPlan.get_test_cases(self.id)])
+ # Work around BZ#725726 (attempt to fetch test cases by ids)
+ except xmlrpclib.Fault:
+ log.warning("Failed to fetch {0}'s cases, "
+ "trying again using ids".format(self._identifier))
+ self._current = set([TestCase(id) for id in
+ self._server.TestPlan.get(self.id)["case"]])
self._original = set(self._current)
def _add(self, cases):