diff options
author | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2017-10-20 13:55:49 +0300 |
---|---|---|
committer | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2017-10-20 13:55:49 +0300 |
commit | 7e41ee71df1e9ef3975236abd7f1550c6b0e829a (patch) | |
tree | 414318da4cf69d587dfd3abcf1429b588dbe3758 /cherrypy | |
parent | 3e0af3c77ffdbdd55128b033fbc37afc44ced3b8 (diff) | |
download | cherrypy-git-7e41ee71df1e9ef3975236abd7f1550c6b0e829a.tar.gz |
Improve UUID assertion in logging tests
Diffstat (limited to 'cherrypy')
-rw-r--r-- | cherrypy/test/logtest.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cherrypy/test/logtest.py b/cherrypy/test/logtest.py index e88497a2..9775ba65 100644 --- a/cherrypy/test/logtest.py +++ b/cherrypy/test/logtest.py @@ -176,12 +176,15 @@ class LogCase(object): uuid_log = data[-1] uuid_obj = UUID(uuid_log, version=4) except (TypeError, ValueError): - msg = '%r not a valid UUIDv4' % uuid_log - self._handleLogError(msg, data, marker, log_chunk) + pass # it might be in other chunk else: - if str(uuid_obj) != uuid_log: - msg = '%r not a valid UUIDv4' % uuid_log - self._handleLogError(msg, data, marker, log_chunk) + if str(uuid_obj) == uuid_log: + return + msg = '%r is not a valid UUIDv4' % uuid_log + self._handleLogError(msg, data, marker, log_chunk) + + msg = 'UUIDv4 not found in log' + self._handleLogError(msg, data, marker, log_chunk) def assertLog(self, sliceargs, lines, marker=None): """Fail if log.readlines()[sliceargs] is not contained in 'lines'. |