aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-01-21 11:44:17 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2023-01-21 11:44:17 +0200
commit7d50c226b79d158ed08e925369560727993fb0b7 (patch)
tree20e20e0c3b3ce78d5ed82472f7a225aa2809dcf1 /tests
parentscan: fix quiet mode with keywords (diff)
downloadpkgcheck-7d50c226b79d158ed08e925369560727993fb0b7.tar.gz
pkgcheck-7d50c226b79d158ed08e925369560727993fb0b7.tar.bz2
pkgcheck-7d50c226b79d158ed08e925369560727993fb0b7.zip
SuspiciousSrcUriChange: fix false positive with mirrors
The original code for comparing for URL change was giving false positives when the URI is mirror based, since an object was used to compare. Pre-compute the URI string and use strings for comparison. Also add a test for that failure. Resolves: https://github.com/pkgcore/pkgcheck/issues/531 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/checks/test_git.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/checks/test_git.py b/tests/checks/test_git.py
index b69893d8..eed40e13 100644
--- a/tests/checks/test_git.py
+++ b/tests/checks/test_git.py
@@ -702,6 +702,12 @@ class TestGitPkgCommitsCheck(ReportTestCase):
self.init_check()
r = self.assertReport(self.check, self.source)
assert r == git_mod.SuspiciousSrcUriChange(old_url, new_url, distfile[1], pkg=CP("cat/pkg"))
+ # revert change and check for no report with same mirror url
+ self.child_git_repo.run(["git", "reset", "--hard", "origin/main"])
+ self.child_repo.create_ebuild("cat/pkg-1", src_uri=old_url, eapi="8")
+ self.child_git_repo.add_all("cat/pkg: bump EAPI", signoff=True)
+ self.init_check()
+ self.assertNoReport(self.check, self.source)
class TestGitEclassCommitsCheck(ReportTestCase):