aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-01-20 20:34:08 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2023-01-20 20:34:08 +0200
commit086e4ebc09b6e158ecf7cadd1906c73e9784e12b (patch)
tree67d2a5d33da435dd2224a610cfe27c3e8cedbd0a /tests
parentchecks.git: add type annotations (diff)
downloadpkgcheck-086e4ebc09b6e158ecf7cadd1906c73e9784e12b.tar.gz
pkgcheck-086e4ebc09b6e158ecf7cadd1906c73e9784e12b.tar.bz2
pkgcheck-086e4ebc09b6e158ecf7cadd1906c73e9784e12b.zip
scan: suppress non-error results in quiet mode
When in quiet mode, include in scan only results of error level. Resolves: https://github.com/pkgcore/pkgcheck/issues/413 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts/test_pkgcheck_scan.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/scripts/test_pkgcheck_scan.py b/tests/scripts/test_pkgcheck_scan.py
index 84030760..7d191ee5 100644
--- a/tests/scripts/test_pkgcheck_scan.py
+++ b/tests/scripts/test_pkgcheck_scan.py
@@ -486,6 +486,19 @@ class TestPkgcheckScan:
results = list(self.scan(self.scan_args + ["-r", repo.location, "cat/unknown"]))
assert not results
+ def test_scan_quiet(self, repo):
+ # create an ebuild referencing variable in homepage
+ repo.create_ebuild("cat/pkg-0", homepage="https://example.com/${PN}")
+
+ # in non-quiet mode, the result is shown
+ results = list(self.scan(self.scan_args + ["-r", repo.location]))
+ assert len(results) == 1
+
+ # in quiet mode, the result is suppressed
+ for arg in ("-q", "--quiet"):
+ results = list(self.scan(self.scan_args + ["-r", repo.location, arg]))
+ assert not results
+
def test_explict_skip_check(self):
"""SkipCheck exceptions are raised when triggered for explicitly enabled checks."""
error = "network checks not enabled"