diff options
author | Zuul <zuul@review.opendev.org> | 2023-04-26 17:49:02 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-04-26 17:49:02 +0000 |
commit | c4a6f6fcd619e8882a74e24263c1f7c853400081 (patch) | |
tree | 709f22272de303f832db887be62e96dde399b27c /tests/base.py | |
parent | aad1fe11a6d3da1c8b3eb6dbb97f35212b042643 (diff) | |
parent | 4e0da6221409d63124b2d8ba257df03209314a3d (diff) | |
download | zuul-c4a6f6fcd619e8882a74e24263c1f7c853400081.tar.gz |
Merge "Further fix getting topic changes by git needs"
Diffstat (limited to 'tests/base.py')
-rw-r--r-- | tests/base.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/base.py b/tests/base.py index 1cfcecde5..c031497a2 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1504,8 +1504,9 @@ class FakeGerritConnection(gerritconnection.GerritConnection): msg = msg[1:-1] l = [queryMethod(change) for change in self.changes.values() if msg in change.data['commitMessage']] - elif query.startswith("status:"): + else: cut_off_time = 0 + l = list(self.changes.values()) parts = query.split(" ") for part in parts: if part.startswith("-age"): @@ -1513,17 +1514,18 @@ class FakeGerritConnection(gerritconnection.GerritConnection): cut_off_time = ( datetime.datetime.now().timestamp() - float(age[:-1]) ) - l = [ - queryMethod(change) for change in self.changes.values() - if change.data["lastUpdated"] >= cut_off_time - ] - elif query.startswith('topic:'): - topic = query[len('topic:'):].strip() - l = [queryMethod(change) for change in self.changes.values() - if topic in change.data.get('topic', '')] - else: - # Query all open changes - l = [queryMethod(change) for change in self.changes.values()] + l = [ + change for change in l + if change.data["lastUpdated"] >= cut_off_time + ] + if part.startswith('topic:'): + topic = part[len('topic:'):].strip() + l = [ + change for change in l + if 'topic' in change.data + and topic in change.data['topic'] + ] + l = [queryMethod(change) for change in l] return l def simpleQuerySSH(self, query, event=None): |