From 24214d017a5caa561d3d3903aa248d789748b825 Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Wed, 1 Dec 2021 16:29:39 +0100 Subject: [PATCH] Fixing tests after reintroducing the lazy='joined' for Updates comments and build Signed-off-by: Adam Saleh (cherry picked from commit 65f2e93ba9e681f7c3f8a7b0a0ee7475ab4d6d1f) --- bodhi/tests/server/services/test_updates.py | 5 +++-- bodhi/tests/server/test_models.py | 3 ++- bodhi/tests/server/test_push.py | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bodhi/tests/server/services/test_updates.py b/bodhi/tests/server/services/test_updates.py index 9a8c98634f..a83bd60d6a 100644 --- a/bodhi/tests/server/services/test_updates.py +++ b/bodhi/tests/server/services/test_updates.py @@ -2938,8 +2938,9 @@ def test_list_updates_with_multiple_statuses(self): res = self.app.get('/updates/', {"status": ["pending", "testing"]}) body = res.json_body assert len(body['updates']) == 2 - assert body['updates'][0]['title'] == 'bodhi-2.0-1.fc17' - assert body['updates'][1]['title'] == 'python-nose-1.3.7-11.fc17' + expected = ['bodhi-2.0-1.fc17', 'python-nose-1.3.7-11.fc17'] + actual = sorted(update['title'] for update in body['updates']) + assert expected == actual def test_list_updates_by_suggest(self): res = self.app.get('/updates/', {"suggest": "unspecified"}) diff --git a/bodhi/tests/server/test_models.py b/bodhi/tests/server/test_models.py index f2b63f9369..2ff9716796 100644 --- a/bodhi/tests/server/test_models.py +++ b/bodhi/tests/server/test_models.py @@ -188,7 +188,8 @@ def test__to_json_no_seen(self): def test_grid_columns(self): """Assert correct return value from the grid_columns() method.""" - assert model.Build.grid_columns() == ['nvr', 'signed', 'release_id', 'type', 'epoch'] + assert sorted(model.Build.grid_columns()) == sorted(['nvr', 'signed', 'release_id', + 'type', 'epoch']) def test_find_child_for_rpm(self): subclass = model.Package.find_polymorphic_child(model.ContentType.rpm) diff --git a/bodhi/tests/server/test_push.py b/bodhi/tests/server/test_push.py index 5ccb88b651..0507287d7f 100644 --- a/bodhi/tests/server/test_push.py +++ b/bodhi/tests/server/test_push.py @@ -202,9 +202,9 @@ def test_archived_release(self): ===== ===== -bodhi-2.0-1.fc17 python-nose-1.3.7-11.fc17 python-paste-deploy-1.5.2-8.fc17 +bodhi-2.0-1.fc17 Push these 3 updates? [y/N]: n @@ -215,8 +215,8 @@ def test_archived_release(self): ===== ===== -python-nose-1.3.7-11.fc17 ejabberd-16.09-4.fc17 +python-nose-1.3.7-11.fc17 Push these 2 updates? [y/N]: y @@ -230,9 +230,9 @@ def test_archived_release(self): ===== ===== -bodhi-2.0-1.fc17 python-nose-1.3.7-11.fc17 python-paste-deploy-1.5.2-8.fc17 +bodhi-2.0-1.fc17 Pushing 3 updates. @@ -295,8 +295,8 @@ def test_archived_release(self): ===== ===== -bodhi-2.0-1.fc17 python-paste-deploy-1.5.2-8.fc17 +bodhi-2.0-1.fc17 Push these 2 updates? [y/N]: y