2020-10-13 00:55:40 +02:00
|
|
|
from pythontest.DatabaseConnection import DatabaseConnection
|
|
|
|
|
|
|
|
|
|
|
|
def checkServices(db: DatabaseConnection, services: list):
|
|
|
|
alldata = [ route for id in services for route in db.query('service %s route:123,234,345,456' % id) ]
|
2020-10-12 23:25:06 +02:00
|
|
|
result = [ (data['id'], issue) for data in alldata if (issue := checkData(data)) is not None ]
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
def checkData(data: dict):
|
|
|
|
result = None
|
|
|
|
if data['id'] % 2 != 0:
|
|
|
|
result = data['name'] + ' is not even'
|
|
|
|
return result
|