Merge lp:~jamestait/click-reviewers-tools/readme-not-required-for-squashfs into lp:click-reviewers-tools

Proposed by James Tait
Status: Merged
Merged at revision: 571
Proposed branch: lp:~jamestait/click-reviewers-tools/readme-not-required-for-squashfs
Merge into: lp:click-reviewers-tools
Diff against target: 39 lines (+18/-0)
2 files modified
clickreviews/cr_lint.py (+3/-0)
clickreviews/tests/test_cr_lint.py (+15/-0)
To merge this branch: bzr merge lp:~jamestait/click-reviewers-tools/readme-not-required-for-squashfs
Reviewer Review Type Date Requested Status
Jamie Strandboge (community) Approve
Review via email: mp+284662@code.launchpad.net

Description of the change

Don't check for the presence of readme.md if the package is a squashfs filesystem. Snappy 2.0 uses squashfs as its file format, and doesn't require readme.md.

To post a comment you must log in.
569. By James Tait

Merged origin/trunk into readme-not-required-for-squashfs.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

LGTM. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'clickreviews/cr_lint.py'
2--- clickreviews/cr_lint.py 2016-02-01 18:13:22 +0000
3+++ clickreviews/cr_lint.py 2016-02-01 19:19:13 +0000
4@@ -1139,6 +1139,9 @@
5 if not self.is_snap:
6 return
7
8+ if is_squashfs(self.pkg_filename):
9+ return
10+
11 contents = self._extract_readme_md()
12
13 t = 'info'
14
15=== modified file 'clickreviews/tests/test_cr_lint.py'
16--- clickreviews/tests/test_cr_lint.py 2016-02-01 08:59:56 +0000
17+++ clickreviews/tests/test_cr_lint.py 2016-02-01 19:19:13 +0000
18@@ -1754,6 +1754,21 @@
19 expected_counts = {'info': 2, 'warn': 0, 'error': 0}
20 self.check_results(r, expected_counts)
21
22+ def test_check_snappy_readme_md_squashfs(self):
23+ '''Test check_snappy_readme_md() - squashfs file'''
24+ with patch("clickreviews.cr_lint.is_squashfs") as mock_is_squashfs:
25+ mock_is_squashfs.return_value = True
26+ with patch("clickreviews.cr_lint.ClickReviewLint."
27+ "_extract_readme_md") as mock_readme_md:
28+ mock_readme_md.return_value = "Something suitably long"
29+ c = ClickReviewLint(self.test_name)
30+ c.unpack_dir = "/nonexistent.nonexec"
31+ c.check_snappy_readme_md()
32+ r = c.click_report
33+ expected_counts = {'info': None, 'warn': 0, 'error': 0}
34+ self.check_results(r, expected_counts)
35+ self.assertFalse(mock_readme_md.called)
36+
37 def test_check_snappy_readme_md_bad(self):
38 '''Test check_snappy_readme_md() - short'''
39 self.set_test_pkg_yaml("name", "prettylong.name")

Subscribers

People subscribed via source and target branches