Gerrit approval records have a 'by' field
We need to look one level deeper.
Change-Id: I81dbc316ded86739fd7d5413beb7a51a4e57e4f5
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index a74ad17..9787ae1 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -221,11 +221,13 @@
approval = {'description': self.categories[category][0],
'type': category,
'value': str(value),
- 'username': username,
- 'email': username + '@example.com',
+ 'by': {
+ 'username': username,
+ 'email': username + '@example.com',
+ },
'grantedOn': int(granted_on)}
for i, x in enumerate(self.patchsets[-1]['approvals'][:]):
- if x['username'] == username and x['type'] == category:
+ if x['by']['username'] == username and x['type'] == category:
del self.patchsets[-1]['approvals'][i]
self.patchsets[-1]['approvals'].append(approval)
event = {'approvals': [approval],