Merge lp:~dholbach/click-reviewers-tools/1395204 into lp:click-reviewers-tools

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 356
Proposed branch: lp:~dholbach/click-reviewers-tools/1395204
Merge into: lp:click-reviewers-tools
Diff against target: 67 lines (+32/-5)
2 files modified
clickreviews/cr_lint.py (+18/-5)
clickreviews/tests/test_cr_lint.py (+14/-0)
To merge this branch: bzr merge lp:~dholbach/click-reviewers-tools/1395204
Reviewer Review Type Date Requested Status
Martin Albisetti (community) Approve
Review via email: mp+247042@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Albisetti (beuno) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'clickreviews/cr_lint.py'
--- clickreviews/cr_lint.py 2015-01-13 18:08:32 +0000
+++ clickreviews/cr_lint.py 2015-01-20 16:50:25 +0000
@@ -45,12 +45,13 @@
45 # arm64 - compiled, single arch (not available yet)45 # arm64 - compiled, single arch (not available yet)
46 # ppc64el - compiled, single arch (not available yet)46 # ppc64el - compiled, single arch (not available yet)
47 # powerpc - compiled, single arch (not available yet)47 # powerpc - compiled, single arch (not available yet)
48 self.valid_compiled_architectures = ['armhf',
49 'i386',
50 'amd64',
51 ]
48 self.valid_control_architectures = ['all',52 self.valid_control_architectures = ['all',
49 'multi',53 'multi',
50 'armhf',54 ] + self.valid_compiled_architectures
51 'i386',
52 'amd64',
53 ]
54 self.vcs_dirs = ['.bzr*', '.git*', '.svn*', '.hg', 'CVS*', 'RCS*']55 self.vcs_dirs = ['.bzr*', '.git*', '.svn*', '.hg', 'CVS*', 'RCS*']
5556
56 if 'maintainer' in self.manifest:57 if 'maintainer' in self.manifest:
@@ -200,7 +201,19 @@
200 n = 'control_architecture_match'201 n = 'control_architecture_match'
201 s = 'OK'202 s = 'OK'
202 if 'architecture' in self.manifest:203 if 'architecture' in self.manifest:
203 if control['Architecture'] != self.manifest['architecture']:204 if control['Architecture'] == "multi":
205 if not isinstance(self.manifest['architecture'],
206 (list, tuple)):
207 t = 'error'
208 s = 'If arch=multi, manifest architecture needs to ' + \
209 'list all the individual architectures.'
210 elif list(filter(lambda a:
211 a not in self.valid_compiled_architectures,
212 self.manifest['architecture'])):
213 t = 'error'
214 s = 'If arch=multi, manifest architecture needs to ' + \
215 'comprise of only compiled architectures.'
216 elif control['Architecture'] != self.manifest['architecture']:
204 t = 'error'217 t = 'error'
205 s = "Architecture=%s " % control['Architecture'] + \218 s = "Architecture=%s " % control['Architecture'] + \
206 "does not match manifest architecture=%s" % \219 "does not match manifest architecture=%s" % \
207220
=== modified file 'clickreviews/tests/test_cr_lint.py'
--- clickreviews/tests/test_cr_lint.py 2015-01-13 18:08:32 +0000
+++ clickreviews/tests/test_cr_lint.py 2015-01-20 16:50:25 +0000
@@ -367,6 +367,20 @@
367 expected_counts = {'info': 1, 'warn': 0, 'error': 0}367 expected_counts = {'info': 1, 'warn': 0, 'error': 0}
368 self.check_results(r, expected_counts)368 self.check_results(r, expected_counts)
369369
370 def test_check_manifest_valid_arch_multi2(self):
371 '''Test check_manifest_architecture() (valid multi2)'''
372 arch = "multi"
373 self.set_test_manifest("architecture", ["armhf", "i386"])
374 self.set_test_control("Architecture", arch)
375 test_name = "%s_%s_%s.click" % (self.test_control['Package'],
376 self.test_control['Version'],
377 arch)
378 c = ClickReviewLint(test_name)
379 c.check_manifest_architecture()
380 r = c.click_report
381 expected_counts = {'info': 1, 'warn': 0, 'error': 0}
382 self.check_results(r, expected_counts)
383
370 def test_check_manifest_invalid_arch_multi_nonexistent(self):384 def test_check_manifest_invalid_arch_multi_nonexistent(self):
371 '''Test check_manifest_architecture() (invalid multi)'''385 '''Test check_manifest_architecture() (invalid multi)'''
372 arch = "multi"386 arch = "multi"

Subscribers

People subscribed via source and target branches