Skip to content

Commit

Permalink
Use recent lockfile format in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored and neersighted committed Sep 9, 2022
1 parent d186c95 commit f2b1739
Showing 1 changed file with 83 additions and 37 deletions.
120 changes: 83 additions & 37 deletions tests/test_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_exporter_can_export_requirements_txt_with_standard_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": []},
"files": {"foo": [], "bar": []},
},
}
)
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_exporter_can_export_requirements_txt_with_standard_packages_and_markers
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": [], "baz": []},
"files": {"foo": [], "bar": [], "baz": []},
},
}
)
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_exporter_can_export_requirements_txt_poetry(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {
"files": {
"poetry": [],
"keyring": [],
"secretstorage": [],
Expand Down Expand Up @@ -368,7 +368,7 @@ def test_exporter_can_export_requirements_txt_pyinstaller(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"pyinstaller": [], "altgraph": [], "macholib": []},
"files": {"pyinstaller": [], "altgraph": [], "macholib": []},
},
}
)
Expand Down Expand Up @@ -453,7 +453,7 @@ def test_exporter_can_export_requirements_txt_with_nested_packages_and_markers(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"a": [], "b": [], "c": [], "d": []},
"files": {"a": [], "b": [], "c": [], "d": []},
},
}
)
Expand Down Expand Up @@ -529,7 +529,7 @@ def test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_a
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"a": [], "b": []},
"files": {"a": [], "b": []},
},
}
)
Expand Down Expand Up @@ -582,7 +582,10 @@ def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -628,7 +631,16 @@ def test_exporter_can_export_requirements_txt_with_standard_packages_and_sorted_
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["67890", "12345"], "bar": ["67890", "12345"]},
"files": {
"foo": [
{"name": "foo1.whl", "hash": "67890"},
{"name": "foo2.whl", "hash": "12345"},
],
"bar": [
{"name": "bar1.whl", "hash": "67890"},
{"name": "bar2.whl", "hash": "12345"},
],
},
},
}
)
Expand Down Expand Up @@ -676,7 +688,10 @@ def test_exporter_requirements_txt_with_standard_packages_and_hashes_disabled(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -721,7 +736,10 @@ def test_exporter_exports_requirements_txt_without_dev_packages_by_default(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -765,7 +783,10 @@ def test_exporter_exports_requirements_txt_with_dev_packages_if_opted_in(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -812,7 +833,10 @@ def test_exporter_exports_requirements_txt_without_groups_if_set_explicity(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -852,7 +876,10 @@ def test_exporter_exports_requirements_txt_without_optional_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -937,7 +964,11 @@ def test_exporter_exports_requirements_txt_with_optional_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"], "spam": ["abcde"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
"spam": [{"name": "spam.whl", "hash": "abcde"}],
},
},
"extras": {"feature_bar": ["bar"]},
}
Expand Down Expand Up @@ -984,7 +1015,7 @@ def test_exporter_can_export_requirements_txt_with_git_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": []},
"files": {"foo": []},
},
}
)
Expand Down Expand Up @@ -1038,7 +1069,7 @@ def test_exporter_can_export_requirements_txt_with_nested_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": []},
"files": {"foo": [], "bar": []},
},
}
)
Expand Down Expand Up @@ -1092,7 +1123,7 @@ def test_exporter_can_export_requirements_txt_with_nested_packages_cyclic(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": [], "baz": []},
"files": {"foo": [], "bar": [], "baz": []},
},
}
)
Expand Down Expand Up @@ -1162,7 +1193,7 @@ def test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": [], "baz": []},
"files": {"foo": [], "bar": [], "baz": []},
},
}
)
Expand Down Expand Up @@ -1210,7 +1241,7 @@ def test_exporter_can_export_requirements_txt_with_git_packages_and_markers(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": []},
"files": {"foo": []},
},
}
)
Expand Down Expand Up @@ -1251,7 +1282,7 @@ def test_exporter_can_export_requirements_txt_with_directory_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": []},
"files": {"foo": []},
},
}
)
Expand Down Expand Up @@ -1322,7 +1353,7 @@ def test_exporter_can_export_requirements_txt_with_nested_directory_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": [], "baz": []},
"files": {"foo": [], "bar": [], "baz": []},
},
}
)
Expand Down Expand Up @@ -1367,7 +1398,7 @@ def test_exporter_can_export_requirements_txt_with_directory_packages_and_marker
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": []},
"files": {"foo": []},
},
}
)
Expand Down Expand Up @@ -1409,7 +1440,7 @@ def test_exporter_can_export_requirements_txt_with_file_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": []},
"files": {"foo": []},
},
}
)
Expand Down Expand Up @@ -1452,7 +1483,7 @@ def test_exporter_can_export_requirements_txt_with_file_packages_and_markers(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": []},
"files": {"foo": []},
},
}
)
Expand Down Expand Up @@ -1507,7 +1538,10 @@ def test_exporter_exports_requirements_txt_with_legacy_packages(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -1567,7 +1601,10 @@ def test_exporter_exports_requirements_txt_with_url_false(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -1619,7 +1656,9 @@ def test_exporter_exports_requirements_txt_with_legacy_packages_trusted_host(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"bar": ["67890"]},
"files": {
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -1701,7 +1740,7 @@ def test_exporter_exports_requirements_txt_with_dev_extras(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": [], "baz": []},
"files": {"foo": [], "bar": [], "baz": []},
},
}
)
Expand Down Expand Up @@ -1776,7 +1815,11 @@ def test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_so
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"], "baz": ["24680"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
"baz": [{"name": "baz.whl", "hash": "24680"}],
},
},
}
)
Expand Down Expand Up @@ -1842,7 +1885,10 @@ def test_exporter_exports_requirements_txt_with_legacy_packages_and_credentials(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": ["12345"], "bar": ["67890"]},
"files": {
"foo": [{"name": "foo.whl", "hash": "12345"}],
"bar": [{"name": "bar.whl", "hash": "67890"}],
},
},
}
)
Expand Down Expand Up @@ -1896,7 +1942,7 @@ def test_exporter_exports_requirements_txt_to_standard_output(
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": []},
"files": {"foo": [], "bar": []},
},
}
)
Expand Down Expand Up @@ -1993,7 +2039,7 @@ def test_exporter_doesnt_confuse_repeated_packages(
"content-hash": (
"832b13a88e5020c27cbcd95faa577bf0dbf054a65c023b45dc9442b640d414e6"
),
"hashes": {
"files": {
"celery": [],
"click-didyoumean": [],
"click-plugins": [],
Expand Down Expand Up @@ -2112,7 +2158,7 @@ def test_exporter_handles_extras_next_to_non_extras(
"content-hash": (
"832b13a88e5020c27cbcd95faa577bf0dbf054a65c023b45dc9442b640d414e6"
),
"hashes": {
"files": {
"localstack": [],
"localstack-ext": [],
"something": [],
Expand Down Expand Up @@ -2202,7 +2248,7 @@ def test_exporter_handles_overlapping_python_versions(
"content-hash": (
"832b13a88e5020c27cbcd95faa577bf0dbf054a65c023b45dc9442b640d414e6"
),
"hashes": {
"files": {
"ipython": [],
"slash": [],
},
Expand Down Expand Up @@ -2292,7 +2338,7 @@ def test_exporter_omits_unwanted_extras(
"content-hash": (
"832b13a88e5020c27cbcd95faa577bf0dbf054a65c023b45dc9442b640d414e6"
),
"hashes": {
"files": {
"foo": [],
"pytest": [],
},
Expand Down Expand Up @@ -2360,7 +2406,7 @@ def test_exporter_respects_package_sources(tmp_dir: str, poetry: Poetry) -> None
"content-hash": (
"832b13a88e5020c27cbcd95faa577bf0dbf054a65c023b45dc9442b640d414e6"
),
"hashes": {
"files": {
"foo": [],
},
},
Expand Down Expand Up @@ -2432,7 +2478,7 @@ def test_exporter_tolerates_non_existent_extra(tmp_dir: str, poetry: Poetry) ->
"metadata": {
"python-versions": "*",
"content-hash": "123456789",
"hashes": {"foo": [], "bar": []},
"files": {"foo": [], "bar": []},
},
}
)
Expand Down

0 comments on commit f2b1739

Please sign in to comment.