tests: Ensure LogLine gets the right json type

This commit is contained in:
Florian Bruhin 2016-08-03 09:06:07 +02:00
parent 0f79027a0e
commit a49c524b00

View File

@ -73,6 +73,8 @@ class LogLine(testprocess.Line):
line = json.loads(data)
except ValueError:
raise testprocess.InvalidLine(data)
if not isinstance(line, dict):
raise testprocess.InvalidLine(data)
self.timestamp = datetime.datetime.fromtimestamp(line['created'])
self.loglevel = line['levelno']