requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7fc16e471da0>
swh_storage = <swh.storage.proxies.retry.RetryingProxyStorage object at 0x7fc16e4889e8>
def test_get_versions(requests_mock_datadir, swh_storage):
loader = CondaLoader(
swh_storage, url=ORIGINS[0]["url"], artifacts=ORIGINS[0]["artifacts"]
)
> assert loader.get_versions() == [
"linux-64/0.11.1-py36h9f0ad1d_1",
"linux-64/0.11.1-py36hc560c46_1",
]
.tox/py3/lib/python3.7/site-packages/swh/loader/package/conda/tests/test_conda.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/loader/package/conda/loader.py:105: in get_versions
versions.sort(key=parse_version)
.tox/py3/lib/python3.7/site-packages/packaging/version.py:52: in parse
return Version(version)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'Version' object has no attribute '_version'") raised in repr()] Version object at 0x7fc16e3fb2b0>
version = 'linux-64/0.11.1-py36h9f0ad1d_1'
def __init__(self, version: str) -> None:
"""Initialize a Version object.
:param version:
The string representation of a version which will be parsed and normalized
before use.
:raises InvalidVersion:
If the ``version`` does not conform to PEP 440 in any way then this
exception will be raised.
"""
# Validate the version and parse it into pieces
match = self._regex.search(version)
if not match:
> raise InvalidVersion(f"Invalid version: '{version}'")
E packaging.version.InvalidVersion: Invalid version: 'linux-64/0.11.1-py36h9f0ad1d_1'
.tox/py3/lib/python3.7/site-packages/packaging/version.py:197: InvalidVersion
TEST RESULT
TEST RESULT
- Run At
- Dec 20 2022, 11:44 AM