Skip to content

Commit 41f44cc

Browse files
committed
Use literal file names in test_commands
There is no need for the strings to be real file paths. Using string literals makes the test obvious to follow. This continues the work aimed at removing the binary test artifacts from the repository.
1 parent 4406034 commit 41f44cc

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

Diff for: tests/test_commands.py

+24-24
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import pytest
44

5-
from tests import helpers
65
from twine import commands
76
from twine import exceptions
87

@@ -55,38 +54,39 @@ def test_find_dists_handles_real_files():
5554
def test_split_inputs():
5655
"""Split inputs into dists, signatures, and attestations."""
5756
inputs = [
58-
helpers.WHEEL_FIXTURE,
59-
helpers.WHEEL_FIXTURE + ".asc",
60-
helpers.WHEEL_FIXTURE + ".build.attestation",
61-
helpers.WHEEL_FIXTURE + ".publish.attestation",
62-
helpers.SDIST_FIXTURE,
63-
helpers.SDIST_FIXTURE + ".asc",
64-
helpers.NEW_WHEEL_FIXTURE,
65-
helpers.NEW_WHEEL_FIXTURE + ".frob.attestation",
66-
helpers.NEW_SDIST_FIXTURE,
57+
"dist/twine-1.5.0-py2.py3-none-any.whl",
58+
"dist/twine-1.5.0-py2.py3-none-any.whl.asc",
59+
"dist/twine-1.5.0-py2.py3-none-any.whl.build.attestation",
60+
"dist/twine-1.5.0-py2.py3-none-any.whl.build.publish.attestation",
61+
"dist/twine-1.5.0.tar.gz",
62+
"dist/twine-1.5.0.tar.gz.asc",
63+
"dist/twine-1.6.5-py2.py3-none-any.whl",
64+
"dist/twine-1.6.5-py2.py3-none-any.whl.frob.attestation",
65+
"dist/twine-1.6.5.tar.gz",
6766
]
6867

6968
inputs = commands._split_inputs(inputs)
7069

7170
assert inputs.dists == [
72-
helpers.WHEEL_FIXTURE,
73-
helpers.SDIST_FIXTURE,
74-
helpers.NEW_WHEEL_FIXTURE,
75-
helpers.NEW_SDIST_FIXTURE,
71+
"dist/twine-1.5.0-py2.py3-none-any.whl",
72+
"dist/twine-1.5.0.tar.gz",
73+
"dist/twine-1.6.5-py2.py3-none-any.whl",
74+
"dist/twine-1.6.5.tar.gz",
7675
]
7776

78-
expected_signatures = {
79-
os.path.basename(dist) + ".asc": dist + ".asc"
80-
for dist in [helpers.WHEEL_FIXTURE, helpers.SDIST_FIXTURE]
77+
assert inputs.signatures == {
78+
"twine-1.5.0-py2.py3-none-any.whl.asc": "dist/twine-1.5.0-py2.py3-none-any.whl.asc", # noqa: E501
79+
"twine-1.5.0.tar.gz.asc": "dist/twine-1.5.0.tar.gz.asc",
8180
}
82-
assert inputs.signatures == expected_signatures
8381

8482
assert inputs.attestations_by_dist == {
85-
helpers.WHEEL_FIXTURE: [
86-
helpers.WHEEL_FIXTURE + ".build.attestation",
87-
helpers.WHEEL_FIXTURE + ".publish.attestation",
83+
"dist/twine-1.5.0-py2.py3-none-any.whl": [
84+
"dist/twine-1.5.0-py2.py3-none-any.whl.build.attestation",
85+
"dist/twine-1.5.0-py2.py3-none-any.whl.build.publish.attestation",
8886
],
89-
helpers.SDIST_FIXTURE: [],
90-
helpers.NEW_WHEEL_FIXTURE: [helpers.NEW_WHEEL_FIXTURE + ".frob.attestation"],
91-
helpers.NEW_SDIST_FIXTURE: [],
87+
"dist/twine-1.5.0.tar.gz": [],
88+
"dist/twine-1.6.5-py2.py3-none-any.whl": [
89+
"dist/twine-1.6.5-py2.py3-none-any.whl.frob.attestation",
90+
],
91+
"dist/twine-1.6.5.tar.gz": [],
9292
}

0 commit comments

Comments
 (0)