aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-04-24 19:39:20 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2023-04-24 19:39:20 +0300
commitfdcf83d0811019e0a465006493fe4acad77043da (patch)
tree90ea8008b6b4041eebd444982f4196055bcebd4b /tests
parentMissingEAPIBlankLine: new check for missing blank after EAPI (diff)
downloadpkgcheck-fdcf83d0811019e0a465006493fe4acad77043da.tar.gz
pkgcheck-fdcf83d0811019e0a465006493fe4acad77043da.tar.bz2
pkgcheck-fdcf83d0811019e0a465006493fe4acad77043da.zip
MissingEAPIBlankLine: make it optional
Requested by multiple devs, maybe in future we would improve logic, and un-optional it. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/checks/test_whitespace.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/checks/test_whitespace.py b/tests/checks/test_whitespace.py
index f90495b6..e6324d77 100644
--- a/tests/checks/test_whitespace.py
+++ b/tests/checks/test_whitespace.py
@@ -150,3 +150,21 @@ class TestMultipleChecks(WhitespaceCheckTest):
reports = self.assertReports(self.check, fake_pkg)
assert len(reports) == 4
+
+
+class TestMissingWhitespaceCheck(misc.ReportTestCase):
+ check_kls = whitespace.MissingWhitespaceCheck
+ check = whitespace.MissingWhitespaceCheck(None)
+
+ def test_it(self):
+ fake_src = [
+ "# This is a comment\n",
+ "# This is a comment\n",
+ "# This is a comment, and no blank line before EAPI\n",
+ "EAPI=8\n",
+ "inherit fake\n", # no blank line after EAPI=
+ ]
+ fake_pkg = misc.FakePkg("dev-util/diffball-0.5", lines=fake_src)
+
+ r = self.assertReport(self.check, fake_pkg)
+ assert isinstance(r, whitespace.MissingEAPIBlankLine)