From f747d36737eff05dfaef7f602d0fc4ec9c68b70b Mon Sep 17 00:00:00 2001 From: Matt Kramer Date: Mon, 21 Oct 2024 22:14:40 -0500 Subject: [PATCH] Add test to cover parse_specs (#729) * Add test for parse_specs to attempt to reproduce * chore: lint * Rename file and add a comment * Change username --- tests/utils/test_spec.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/utils/test_spec.py diff --git a/tests/utils/test_spec.py b/tests/utils/test_spec.py new file mode 100644 index 00000000..69f4068d --- /dev/null +++ b/tests/utils/test_spec.py @@ -0,0 +1,12 @@ +# pylint: disable=missing-module-docstring,missing-function-docstring +import binstar_client.utils.spec + + +def test_parse_specs(): + # Reproducing for https://github.com/anaconda/anaconda-client/issues/642 + spec = binstar_client.utils.spec.parse_specs("someuser/foo/1.2.3/blah-1.2.3.tar.bz2?x=1") + assert spec.user == "someuser" + assert spec.name == "foo" + assert spec.version == "1.2.3" + assert spec.basename == "blah-1.2.3.tar.bz2" + assert spec.attrs == {"x": "1"}