PIM testing: ensure that no ERROR messages are printed

This covers D-Bus log messages and stdout. Adding the check revealed
several issues which were fixed in the previous commits.
This commit is contained in:
Patrick Ohly 2013-02-20 14:53:51 +01:00
parent e6c5d574ae
commit a0b5ea8711

View file

@ -474,6 +474,16 @@ END:VCARD(\r|\n)*''',
'addressbook']) 'addressbook'])
def run(self, result): def run(self, result):
# No errors must be logged. During testRead, libphonenumber used to print
# [ERROR] Number too short to be viable: 8
# [ERROR] The string supplied did not seem to be a phone number.
# to stdout until we reduced the log level.
#
# We check both D-Bus messages (which did not contain that
# text, but some other error messages) and the servers stdout.
self.runTestDBusCheck = lambda test, log: test.assertNotIn('ERROR', log)
self.runTestOutputCheck = self.runTestDBusCheck
# Runtime varies a lot when using valgrind, because # Runtime varies a lot when using valgrind, because
# of the need to check an additional process. Allow # of the need to check an additional process. Allow
# a lot more time when running under valgrind. # a lot more time when running under valgrind.
@ -862,6 +872,11 @@ END:VCARD
expected = sources.copy() expected = sources.copy()
peers = {} peers = {}
# Disable the default checking because
# we trigger one ERROR message.
self.runTestDBusCheck = None
self.runTestOutputCheck = None
# dummy peer directory # dummy peer directory
contacts = os.path.abspath(os.path.join(xdg_root, 'contacts')) contacts = os.path.abspath(os.path.join(xdg_root, 'contacts'))
os.makedirs(contacts) os.makedirs(contacts)