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

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 549
Proposed branch: lp:~dholbach/click-reviewers-tools/1517017
Merge into: lp:click-reviewers-tools
Diff against target: 71 lines (+30/-2)
3 files modified
clickreviews/cr_scope.py (+1/-1)
clickreviews/tests/test_cr_scope.py (+26/-0)
debian/changelog (+3/-1)
To merge this branch: bzr merge lp:~dholbach/click-reviewers-tools/1517017
Reviewer Review Type Date Requested Status
Jamie Strandboge (community) Approve
Review via email: mp+277679@code.launchpad.net

Commit message

Allow translated scope .ini fields to have 3 letters as their lang_code identifier, ie. 'ast'. (LP: #1517017)

To post a comment you must log in.
549. By Daniel Holbach

fix changelog version number

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

LGTM so long as the testsuite passes. Thanks!

review: Approve
Revision history for this message
Daniel Holbach (dholbach) wrote :

Ran 593 tests in 6.666s

OK

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'clickreviews/cr_scope.py'
2--- clickreviews/cr_scope.py 2015-08-13 21:07:13 +0000
3+++ clickreviews/cr_scope.py 2015-11-17 12:43:53 +0000
4@@ -148,7 +148,7 @@
5 f = i.lower()
6 if f not in required and f not in optional and \
7 (f.split("[")[0] not in translated or not
8- re.search(r'.*\[[a-z][a-z](_[a-z][a-z])?\]$', f)):
9+ re.search('.*\[[a-z]{2,3}(_[a-z]{2,3})?\]$', f)):
10 unknown.append(f)
11
12 if len(unknown) == 1:
13
14=== modified file 'clickreviews/tests/test_cr_scope.py'
15--- clickreviews/tests/test_cr_scope.py 2015-10-16 02:54:07 +0000
16+++ clickreviews/tests/test_cr_scope.py 2015-11-17 12:43:53 +0000
17@@ -145,6 +145,19 @@
18 expected_counts = {'info': None, 'warn': 0, 'error': 0}
19 self.check_results(r, expected_counts)
20
21+ def test_check_scope_ini_translated_field3(self):
22+ '''Test check_scope_ini() - translated field - ast'''
23+ config = self._stub_config()
24+ config['searchhint[ast]'] = "foo"
25+ scope = self._create_scope(config)
26+
27+ self.set_test_scope(self.default_appname, scope)
28+ c = ClickReviewScope(self.test_name)
29+ c.check_scope_ini()
30+ r = c.click_report
31+ expected_counts = {'info': None, 'warn': 0, 'error': 0}
32+ self.check_results(r, expected_counts)
33+
34 def test_check_scope_ini_bad_translated_field(self):
35 '''Test check_scope_ini() - bad translated field'''
36 config = self._stub_config()
37@@ -158,6 +171,19 @@
38 expected_counts = {'info': None, 'warn': 1, 'error': 0}
39 self.check_results(r, expected_counts)
40
41+ def test_check_scope_ini_bad_translated_field2(self):
42+ '''Test check_scope_ini() - translated field - de_DE'''
43+ config = self._stub_config()
44+ config['searchhint[de_DE]'] = "foo"
45+ scope = self._create_scope(config)
46+
47+ self.set_test_scope(self.default_appname, scope)
48+ c = ClickReviewScope(self.test_name)
49+ c.check_scope_ini()
50+ r = c.click_report
51+ expected_counts = {'info': None, 'warn': 0, 'error': 0}
52+ self.check_results(r, expected_counts)
53+
54 def test_check_scope_ini_nonexistent_field(self):
55 '''Test check_scope_ini() - non-existent field'''
56 config = self._stub_config()
57
58=== modified file 'debian/changelog'
59--- debian/changelog 2015-11-12 13:37:12 +0000
60+++ debian/changelog 2015-11-17 12:43:53 +0000
61@@ -30,8 +30,10 @@
62 [ Daniel Holbach ]
63 * Pass absolute path of click or snap file - that way it's safe even if we
64 chdir (LP: #1514346).
65+ * Allow translated scope .ini fields to have 3 letters as their lang_code
66+ identifier, ie. 'ast'. (LP: #1517017)
67
68- -- Jamie Strandboge <jamie@ubuntu.com> Thu, 12 Nov 2015 07:36:49 -0600
69+ -- Daniel Holbach <daniel.holbach@ubuntu.com> Tue, 17 Nov 2015 13:40:38 +0100
70
71 click-reviewers-tools (0.34) wily; urgency=medium
72

Subscribers

People subscribed via source and target branches