diff --git a/owners_client.py b/owners_client.py index fed27af79..0d2f5052d 100644 --- a/owners_client.py +++ b/owners_client.py @@ -203,4 +203,4 @@ class GerritClient(OwnersClient): # random. data = gerrit_util.GetOwnersForFile( self._host, self._project, self._branch, path) - return [d['account']['email'] for d in data] + return [d['account']['email'] for d in data['code_owners']] diff --git a/tests/owners_client_test.py b/tests/owners_client_test.py index 9aaa8493f..4f727b3a7 100644 --- a/tests/owners_client_test.py +++ b/tests/owners_client_test.py @@ -27,23 +27,25 @@ emily = 'emily@example.com' def _get_owners(): - return [ - { - "account": { - "email": 'approver@example.com' - } - }, - { - "account": { - "email": 'reviewer@example.com' + return { + "code_owners": [ + { + "account": { + "email": 'approver@example.com' + } }, - }, - { - "account": { - "email": 'missing@example.com' + { + "account": { + "email": 'reviewer@example.com' + }, }, - } - ] + { + "account": { + "email": 'missing@example.com' + }, + } + ] + }