test-dbus: Catch missing source exception and trigger test failure

TestSessionAPIsDummy.testCheckSource was failing with an error instead
of triggering a test failure.

This patch catches any missing source exceptions and triggers a
failure.
This commit is contained in:
Chris Kühl 2011-06-28 14:33:33 +02:00 committed by Patrick Ohly
parent a93999e269
commit 69b509ec9d
1 changed files with 5 additions and 2 deletions

View File

@ -1649,8 +1649,11 @@ class TestSessionAPIsDummy(unittest.TestCase, DBusUtil):
def testCheckSource(self):
"""TestSessionAPIsDummy.testCheckSource - testCheckSource - test all sources are okay"""
self.setupConfig()
for source in self.sources:
self.session.CheckSource(source, utf8_strings=True)
try:
for source in self.sources:
self.session.CheckSource(source, utf8_strings=True)
except dbus.DBusException, ex:
self.fail(ex)
def testCheckSourceUpdateConfigTemp(self):
"""TestSessionAPIsDummy.testCheckSourceUpdateConfigTemp - test the config is temporary updated and in effect for GetDatabases in the current session. """