From a1e9132da1c3ba41426168733df1602753f608e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hunor=20Csomort=C3=A1ni?= Date: Tue, 10 Dec 2019 11:58:54 +0100 Subject: [PATCH] Tests: adjust some assertions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With #97 the message when reaching out to a quay org not accessible changed: adjust the test expectation accordingly. When deleting all versions, the way versions are sorted in the deleted list changed: make sure both the actual and expected lists are sorted to avoid tests failing for this reason in the future. Remove an unused environment variable from the tox config. Signed-off-by: Hunor Csomortáni --- tests/integration/delete_version/delete_version_test.py | 8 +++----- tests/integration/push_archive/push_archive_test.py | 2 +- tox.ini | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/integration/delete_version/delete_version_test.py b/tests/integration/delete_version/delete_version_test.py index 9512a3c..a86453f 100644 --- a/tests/integration/delete_version/delete_version_test.py +++ b/tests/integration/delete_version/delete_version_test.py @@ -92,11 +92,9 @@ def test_delete_all_versions(omps, quay, tmp_path): response = omps.delete(test_env['test_namespace'], test_env['test_package']) assert response.status_code == requests.codes.ok - assert response.json() == { - 'deleted': versions, - 'organization': test_env['test_namespace'], - 'repo': test_env['test_package'], - } + assert sorted(response.json()["deleted"]) == sorted(versions) + assert response.json()["organization"] == test_env["test_namespace"] + assert response.json()["repo"] == test_env["test_package"] assert not quay.get_releases(test_env['test_namespace'], test_env['test_package'], diff --git a/tests/integration/push_archive/push_archive_test.py b/tests/integration/push_archive/push_archive_test.py index 95b2262..49e49ba 100644 --- a/tests/integration/push_archive/push_archive_test.py +++ b/tests/integration/push_archive/push_archive_test.py @@ -245,7 +245,7 @@ def test_organization_unaccessible_in_quay(omps, tmp_path): assert response.status_code == requests.codes.forbidden assert response.json()['error'] == 'QuayAuthorizationError' - assert 'Cannot retrieve information about package' in response.json()['message'] + assert "Unauthorized access" in response.json()['message'] def test_upload_password_protected_zip(omps): diff --git a/tox.ini b/tox.ini index 22faebb..426463f 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,6 @@ deps = PyYAML operator-courier >= 1.3.0 koji -passenv = OMPS_INT_TEST_* setenv = REQUESTS_CA_BUNDLE = /etc/pki/tls/certs/ca-bundle.crt commands =