diff options
author | Petr Šplíchal <psplicha@redhat.com> | 2011-11-03 15:57:53 +0100 |
---|---|---|
committer | Petr Šplíchal <psplicha@redhat.com> | 2011-11-03 16:06:07 +0100 |
commit | 5721574555aa4125bd690c433ab167e5ea8d7a5b (patch) | |
tree | 326fde1c542b12b8ee352227e0dbad63ae8c5ab1 | |
parent | 5a0099ec5f6f2ca2f1383b70325bd528817cd061 (diff) | |
download | python-nitrate-5721574555aa4125bd690c433ab167e5ea8d7a5b.tar.gz python-nitrate-5721574555aa4125bd690c433ab167e5ea8d7a5b.tar.xz python-nitrate-5721574555aa4125bd690c433ab167e5ea8d7a5b.zip |
Nitrate: Work around BZ#725726 (attempt to fetch test cases by ids)
-rw-r--r-- | Nitrate.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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): |