diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-11-07 20:35:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 21:35:04 +0200 |
commit | fd89c062bda0f3b159a01aab3d67a7fa2f42334e (patch) | |
tree | a1b15448bf73a4746f59ce2c3e52c4fa0f011f50 /tests | |
parent | a0367c2bf05eb89a513972d3895249938b772c44 (diff) | |
download | gitea-fd89c062bda0f3b159a01aab3d67a7fa2f42334e.tar.gz gitea-fd89c062bda0f3b159a01aab3d67a7fa2f42334e.zip |
Allow local package identifiers for PyPI packages (#21690)
Fixes #21683
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/api_packages_pypi_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/integration/api_packages_pypi_test.go b/tests/integration/api_packages_pypi_test.go index 32b3304ca7..0cd6ff7d13 100644 --- a/tests/integration/api_packages_pypi_test.go +++ b/tests/integration/api_packages_pypi_test.go @@ -29,7 +29,7 @@ func TestPackagePyPI(t *testing.T) { user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) packageName := "test-package" - packageVersion := "1.0.1" + packageVersion := "1.0.1+r1234" packageAuthor := "KN4CK3R" packageDescription := "Test Description" @@ -164,7 +164,7 @@ func TestPackagePyPI(t *testing.T) { nodes := htmlDoc.doc.Find("a").Nodes assert.Len(t, nodes, 2) - hrefMatcher := regexp.MustCompile(fmt.Sprintf(`%s/files/%s/%s/test\..+#sha256-%s`, root, packageName, packageVersion, hashSHA256)) + hrefMatcher := regexp.MustCompile(fmt.Sprintf(`%s/files/%s/%s/test\..+#sha256-%s`, root, regexp.QuoteMeta(packageName), regexp.QuoteMeta(packageVersion), hashSHA256)) for _, a := range nodes { for _, att := range a.Attr { |