From 1fc3a75a997f65807cfc4e89deadc2145197e0e4 Mon Sep 17 00:00:00 2001 From: Andreas Eknes Lie Date: Thu, 4 Apr 2024 13:00:42 +0200 Subject: [PATCH] Add tests --- tests/test_lint_upgrade_proposals.py | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/test_lint_upgrade_proposals.py b/tests/test_lint_upgrade_proposals.py index b9f34aa50..bd57d8a07 100644 --- a/tests/test_lint_upgrade_proposals.py +++ b/tests/test_lint_upgrade_proposals.py @@ -112,6 +112,38 @@ def does_not_raise(): 1111-12: python: 3.8.6 """ + +VALID_UPGRADE_PROPOSALS_NESTED_ONE_LEVEL = """ +1111-12: + wheel: + py38: 0.40.0 + py311: 0.40.0 +""" + +VALID_UPGRADE_PROPOSALS_NESTED_TWO_LEVEL = """ +1111-12: + wheel: + rhel7: + py38: 0.40.0 + rhel8: + py38: 0.40.0 + py311: 0.40.0 +""" + +VALID_UPGRADE_PROPOSALS_MULTI_NESTED = """ +1111-12: + python: 3.8.6 + setuptools: + py38: 68.0.0 + py311: 68.0.0 + wheel: + rhel7: + py38: 0.40.0 + rhel8: + py38: 0.40.0 + py311: 0.40.0 +""" + INVALID_UPGRADE_PROPOSALS_DUPLICATE_PACKAGES = """ 1111-11: 1111-12: @@ -217,6 +249,24 @@ def does_not_raise(): ), id="repository_file_missing_package_version", ), + pytest.param( + VALID_UPGRADE_PROPOSALS_NESTED_ONE_LEVEL, + VALID_REPOSITORY, + does_not_raise(), + id="one_level_nested_package_versions_in_upgrade_proposals", + ), + pytest.param( + VALID_UPGRADE_PROPOSALS_NESTED_TWO_LEVEL, + VALID_REPOSITORY, + does_not_raise(), + id="two_level_nested_package_versions_in_upgrade_proposals", + ), + pytest.param( + VALID_UPGRADE_PROPOSALS_MULTI_NESTED, + VALID_REPOSITORY, + does_not_raise(), + id="combined_level_nested_package_versions_in_upgrade_proposals", + ), pytest.param( INVALID_UPGRADE_PROPOSALS_DUPLICATE_PACKAGES, VALID_REPOSITORY,