diff --git a/tests/test_commands.py b/tests/test_commands.py index c5aa31a2..2ae43408 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -2,7 +2,6 @@ import pytest -from tests import helpers from twine import commands from twine import exceptions @@ -55,38 +54,39 @@ def test_find_dists_handles_real_files(): def test_split_inputs(): """Split inputs into dists, signatures, and attestations.""" inputs = [ - helpers.WHEEL_FIXTURE, - helpers.WHEEL_FIXTURE + ".asc", - helpers.WHEEL_FIXTURE + ".build.attestation", - helpers.WHEEL_FIXTURE + ".publish.attestation", - helpers.SDIST_FIXTURE, - helpers.SDIST_FIXTURE + ".asc", - helpers.NEW_WHEEL_FIXTURE, - helpers.NEW_WHEEL_FIXTURE + ".frob.attestation", - helpers.NEW_SDIST_FIXTURE, + "dist/twine-1.5.0-py2.py3-none-any.whl", + "dist/twine-1.5.0-py2.py3-none-any.whl.asc", + "dist/twine-1.5.0-py2.py3-none-any.whl.build.attestation", + "dist/twine-1.5.0-py2.py3-none-any.whl.build.publish.attestation", + "dist/twine-1.5.0.tar.gz", + "dist/twine-1.5.0.tar.gz.asc", + "dist/twine-1.6.5-py2.py3-none-any.whl", + "dist/twine-1.6.5-py2.py3-none-any.whl.frob.attestation", + "dist/twine-1.6.5.tar.gz", ] inputs = commands._split_inputs(inputs) assert inputs.dists == [ - helpers.WHEEL_FIXTURE, - helpers.SDIST_FIXTURE, - helpers.NEW_WHEEL_FIXTURE, - helpers.NEW_SDIST_FIXTURE, + "dist/twine-1.5.0-py2.py3-none-any.whl", + "dist/twine-1.5.0.tar.gz", + "dist/twine-1.6.5-py2.py3-none-any.whl", + "dist/twine-1.6.5.tar.gz", ] - expected_signatures = { - os.path.basename(dist) + ".asc": dist + ".asc" - for dist in [helpers.WHEEL_FIXTURE, helpers.SDIST_FIXTURE] + assert inputs.signatures == { + "twine-1.5.0-py2.py3-none-any.whl.asc": "dist/twine-1.5.0-py2.py3-none-any.whl.asc", # noqa: E501 + "twine-1.5.0.tar.gz.asc": "dist/twine-1.5.0.tar.gz.asc", } - assert inputs.signatures == expected_signatures assert inputs.attestations_by_dist == { - helpers.WHEEL_FIXTURE: [ - helpers.WHEEL_FIXTURE + ".build.attestation", - helpers.WHEEL_FIXTURE + ".publish.attestation", + "dist/twine-1.5.0-py2.py3-none-any.whl": [ + "dist/twine-1.5.0-py2.py3-none-any.whl.build.attestation", + "dist/twine-1.5.0-py2.py3-none-any.whl.build.publish.attestation", ], - helpers.SDIST_FIXTURE: [], - helpers.NEW_WHEEL_FIXTURE: [helpers.NEW_WHEEL_FIXTURE + ".frob.attestation"], - helpers.NEW_SDIST_FIXTURE: [], + "dist/twine-1.5.0.tar.gz": [], + "dist/twine-1.6.5-py2.py3-none-any.whl": [ + "dist/twine-1.6.5-py2.py3-none-any.whl.frob.attestation", + ], + "dist/twine-1.6.5.tar.gz": [], }