diff options
author | Petr Šplíchal <psplicha@redhat.com> | 2011-07-26 13:27:00 +0200 |
---|---|---|
committer | Petr Šplíchal <psplicha@redhat.com> | 2011-07-26 13:27:00 +0200 |
commit | 066577020058f856b91893bea56deffe6384f818 (patch) | |
tree | 007bafebb58b9941edc6e036947ddc666b3ac723 | |
parent | 033b916c4142d17e940b01c130dac53fd0df1728 (diff) | |
download | python-nitrate-066577020058f856b91893bea56deffe6384f818.tar.gz python-nitrate-066577020058f856b91893bea56deffe6384f818.tar.xz python-nitrate-066577020058f856b91893bea56deffe6384f818.zip |
Nitrate: ID may be provided as a string
-rw-r--r-- | Nitrate.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -289,8 +289,11 @@ class Nitrate(object): elif isinstance(id, int): self._id = id else: - raise NitrateError("Invalid {0} id: '{1}'".format( - self.__class__.__name__, id)) + try: + self._id = int(id) + except ValueError: + raise NitrateError("Invalid {0} id: '{1}'".format( + self.__class__.__name__, id)) def __str__(self): """ Short summary about the connection. """ @@ -1273,7 +1276,7 @@ class TestRun(Mutable): self._caseruns = [ CaseRun(testcasehash=testcase, caserunhash=caserun) for caserun in caseruns for testcase in testcases - if testcase["case_id"] == caserun["case_id"]] + if int(testcase["case_id"]) == int(caserun["case_id"])] return self._caseruns @property |