From fa062304ba3d5cf462f19883fefd57e7391fe2a5 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Fri, 9 Sep 2022 17:21:47 +0100 Subject: [PATCH] update mock lockfiles in unit test Bringing them to 2019's format... --- .../commands/self/test_remove_plugins.py | 2 +- tests/console/commands/test_show.py | 54 +++++++++---------- tests/installation/test_installer.py | 34 ++++++------ tests/installation/test_installer_old.py | 26 ++++----- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/tests/console/commands/self/test_remove_plugins.py b/tests/console/commands/self/test_remove_plugins.py index 5821df82356..2b988443469 100644 --- a/tests/console/commands/self/test_remove_plugins.py +++ b/tests/console/commands/self/test_remove_plugins.py @@ -55,7 +55,7 @@ def install_plugin(installed: Repository) -> None: "python-versions": "^3.6", "platform": "*", "content-hash": "123456789", - "hashes": {"poetry-plugin": []}, + "files": {"poetry-plugin": []}, }, } system_pyproject_file.parent.joinpath("poetry.lock").write_text( diff --git a/tests/console/commands/test_show.py b/tests/console/commands/test_show.py index 839c7d76055..112b1a2478d 100644 --- a/tests/console/commands/test_show.py +++ b/tests/console/commands/test_show.py @@ -87,7 +87,7 @@ def test_show_basic_with_installed_packages( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "pytest": []}, + "files": {"cachy": [], "pendulum": [], "pytest": []}, }, } ) @@ -168,7 +168,7 @@ def _configure_project_with_groups(poetry: Poetry, installed: Repository) -> Non "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "pytest": []}, + "files": {"cachy": [], "pendulum": [], "pytest": []}, }, } ) @@ -293,7 +293,7 @@ def test_show_basic_with_installed_packages_single( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": []}, + "files": {"cachy": []}, }, } ) @@ -335,7 +335,7 @@ def test_show_basic_with_installed_packages_single_canonicalized( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"foo-bar": []}, + "files": {"foo-bar": []}, }, } ) @@ -390,7 +390,7 @@ def test_show_basic_with_not_installed_packages_non_decorated( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -446,7 +446,7 @@ def test_show_basic_with_not_installed_packages_decorated( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -516,7 +516,7 @@ def test_show_latest_non_decorated( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -586,7 +586,7 @@ def test_show_latest_decorated( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -655,7 +655,7 @@ def test_show_outdated( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -699,7 +699,7 @@ def test_show_outdated_with_only_up_to_date_packages( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": []}, + "files": {"cachy": []}, }, } ) @@ -768,7 +768,7 @@ def test_show_outdated_has_prerelease_but_not_allowed( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -843,7 +843,7 @@ def test_show_outdated_has_prerelease_and_allowed( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -912,7 +912,7 @@ def test_show_outdated_formatting( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -1029,7 +1029,7 @@ def test_show_outdated_local_dependencies( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": { + "files": { "cachy": [], "pendulum": [], "demo": [], @@ -1136,7 +1136,7 @@ def test_show_outdated_git_dev_dependency( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "demo": [], "pytest": []}, + "files": {"cachy": [], "pendulum": [], "demo": [], "pytest": []}, }, } ) @@ -1235,7 +1235,7 @@ def test_show_outdated_no_dev_git_dev_dependency( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "demo": [], "pytest": []}, + "files": {"cachy": [], "pendulum": [], "demo": [], "pytest": []}, }, } ) @@ -1296,7 +1296,7 @@ def test_show_hides_incompatible_package( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -1353,7 +1353,7 @@ def test_show_all_shows_incompatible_package( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": []}, + "files": {"cachy": [], "pendulum": []}, }, } ) @@ -1429,7 +1429,7 @@ def test_show_non_dev_with_basic_installed_packages( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "pytest": []}, + "files": {"cachy": [], "pendulum": [], "pytest": []}, }, } ) @@ -1505,7 +1505,7 @@ def test_show_with_group_only( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "pytest": []}, + "files": {"cachy": [], "pendulum": [], "pytest": []}, }, } ) @@ -1580,7 +1580,7 @@ def test_show_with_optional_group( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "pytest": []}, + "files": {"cachy": [], "pendulum": [], "pytest": []}, }, } ) @@ -1642,7 +1642,7 @@ def test_show_tree(tester: CommandTester, poetry: Poetry, installed: Repository) "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "msgpack-python": []}, + "files": {"cachy": [], "msgpack-python": []}, }, } ) @@ -1709,7 +1709,7 @@ def test_show_tree_no_dev(tester: CommandTester, poetry: Poetry, installed: Repo "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "msgpack-python": [], "pytest": []}, + "files": {"cachy": [], "msgpack-python": [], "pytest": []}, }, } ) @@ -1768,7 +1768,7 @@ def test_show_tree_why_package( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"a": [], "b": [], "c": []}, + "files": {"a": [], "b": [], "c": []}, }, } ) @@ -1825,7 +1825,7 @@ def test_show_tree_why(tester: CommandTester, poetry: Poetry, installed: Reposit "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"a": [], "b": [], "c": []}, + "files": {"a": [], "b": [], "c": []}, }, } ) @@ -1894,7 +1894,7 @@ def test_show_required_by_deps( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"cachy": [], "pendulum": [], "msgpack-python": []}, + "files": {"cachy": [], "pendulum": [], "msgpack-python": []}, }, } ) @@ -1983,7 +1983,7 @@ def test_show_dependency_installed_from_git_in_dev( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"demo": [], "pendulum": []}, + "files": {"demo": [], "pendulum": []}, }, } ) diff --git a/tests/installation/test_installer.py b/tests/installation/test_installer.py index 1b8938d4dfb..f7fd6213c58 100644 --- a/tests/installation/test_installer.py +++ b/tests/installation/test_installer.py @@ -275,7 +275,7 @@ def test_run_update_after_removing_dependencies( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -351,7 +351,7 @@ def _configure_run_install_dev( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -480,7 +480,7 @@ def test_run_install_does_not_remove_locked_packages_if_installed_but_not_requir "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {package_a.name: [], package_b.name: [], package_c.name: []}, + "files": {package_a.name: [], package_b.name: [], package_c.name: []}, }, } ) @@ -550,7 +550,7 @@ def test_run_install_removes_locked_packages_if_installed_and_synchronization_is "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {package_a.name: [], package_b.name: [], package_c.name: []}, + "files": {package_a.name: [], package_b.name: [], package_c.name: []}, }, } ) @@ -621,7 +621,7 @@ def test_run_install_removes_no_longer_locked_packages_if_installed( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {package_a.name: [], package_b.name: [], package_c.name: []}, + "files": {package_a.name: [], package_b.name: [], package_c.name: []}, }, } ) @@ -699,7 +699,7 @@ def test_run_install_with_synchronization( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {pkg.name: [] for pkg in locked_packages}, + "files": {pkg.name: [] for pkg in locked_packages}, }, } ) @@ -741,7 +741,7 @@ def test_run_whitelist_add( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -798,7 +798,7 @@ def test_run_whitelist_remove( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": []}, + "files": {"A": [], "B": []}, }, } ) @@ -1370,7 +1370,7 @@ def test_run_with_prereleases( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -1414,7 +1414,7 @@ def test_run_changes_category_if_needed( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -1461,7 +1461,7 @@ def test_run_update_all_with_lock( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -1520,7 +1520,7 @@ def test_run_update_with_locked_extras( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -1662,7 +1662,7 @@ def test_run_install_duplicate_dependencies_different_constraints_with_lock( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -1737,7 +1737,7 @@ def test_run_update_uninstalls_after_removal_transient_dependency( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": []}, + "files": {"A": [], "B": []}, }, } ) @@ -1835,7 +1835,7 @@ def test_run_install_duplicate_dependencies_different_constraints_with_lock_upda "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -2126,7 +2126,7 @@ def test_update_multiple_times_with_split_dependencies_is_idempotent( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": []}, + "files": {"A": [], "B": []}, }, } ) @@ -2451,7 +2451,7 @@ def test_installer_should_use_the_locked_version_of_git_dependencies( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"demo": [], "pendulum": []}, + "files": {"demo": [], "pendulum": []}, }, } ) diff --git a/tests/installation/test_installer_old.py b/tests/installation/test_installer_old.py index baa59649ce9..3c7fe7f2e6f 100644 --- a/tests/installation/test_installer_old.py +++ b/tests/installation/test_installer_old.py @@ -215,7 +215,7 @@ def test_run_update_after_removing_dependencies( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -292,7 +292,7 @@ def test_run_install_no_group( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -389,7 +389,7 @@ def test_run_install_with_synchronization( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {pkg.name: [] for pkg in locked_packages}, + "files": {pkg.name: [] for pkg in locked_packages}, }, } ) @@ -434,7 +434,7 @@ def test_run_whitelist_add( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -491,7 +491,7 @@ def test_run_whitelist_remove( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": []}, + "files": {"A": [], "B": []}, }, } ) @@ -1013,7 +1013,7 @@ def test_run_with_prereleases( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -1057,7 +1057,7 @@ def test_run_changes_category_if_needed( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -1104,7 +1104,7 @@ def test_run_update_all_with_lock( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": []}, + "files": {"A": []}, }, } ) @@ -1163,7 +1163,7 @@ def test_run_update_with_locked_extras( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -1307,7 +1307,7 @@ def test_run_install_duplicate_dependencies_different_constraints_with_lock( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -1385,7 +1385,7 @@ def test_run_update_uninstalls_after_removal_transient_dependency( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": []}, + "files": {"A": [], "B": []}, }, } ) @@ -1486,7 +1486,7 @@ def test_run_install_duplicate_dependencies_different_constraints_with_lock_upda "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": [], "C": []}, + "files": {"A": [], "B": [], "C": []}, }, } ) @@ -1742,7 +1742,7 @@ def test_update_multiple_times_with_split_dependencies_is_idempotent( "python-versions": "*", "platform": "*", "content-hash": "123456789", - "hashes": {"A": [], "B": []}, + "files": {"A": [], "B": []}, }, } )