Merge lp:~zyga/checkbox/fix-1297118 into lp:checkbox

Proposed by Zygmunt Krynicki
Status: Merged
Approved by: Daniel Manrique
Approved revision: 2834
Merged at revision: 2835
Proposed branch: lp:~zyga/checkbox/fix-1297118
Merge into: lp:checkbox
Diff against target: 40 lines (+10/-2)
2 files modified
plainbox/plainbox/impl/job.py (+1/-1)
plainbox/plainbox/impl/test_job.py (+9/-1)
To merge this branch: bzr merge lp:~zyga/checkbox/fix-1297118
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+213073@code.launchpad.net

Description of the change

450217b plainbox:job: fix tr_summary() if summary is not present
17f367e plainbox:job: fix docstring

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks OK, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plainbox/plainbox/impl/job.py'
2--- plainbox/plainbox/impl/job.py 2014-03-24 12:33:35 +0000
3+++ plainbox/plainbox/impl/job.py 2014-03-27 13:58:13 +0000
4@@ -261,7 +261,7 @@
5 Get the translated version of :meth:`summary`
6 """
7 return self.get_normalized_translated_data(
8- self.get_raw_record_value('summary'))
9+ self.get_raw_record_value('summary')) or self.id
10
11 @property
12 def name(self):
13
14=== modified file 'plainbox/plainbox/impl/test_job.py'
15--- plainbox/plainbox/impl/test_job.py 2014-03-21 21:34:00 +0000
16+++ plainbox/plainbox/impl/test_job.py 2014-03-27 13:58:13 +0000
17@@ -488,7 +488,7 @@
18
19 def test_tr_summary(self):
20 """
21- Verify that Provider1.tr_description() works as expected
22+ Verify that Provider1.tr_summary() works as expected
23 """
24 job = JobDefinition(self._full_record.data)
25 with mock.patch.object(job, "get_normalized_translated_data") as mgntd:
26@@ -498,6 +498,14 @@
27 # Ensure tr_summary() returned its return value
28 self.assertEqual(retval, mgntd())
29
30+ def test_tr_summary__falls_back_to_id(self):
31+ """
32+ Verify that Provider1.tr_summary() falls back to job.id, if summary is
33+ not defined
34+ """
35+ job = JobDefinition({'id': 'id'})
36+ self.assertEqual(job.tr_summary(), 'id')
37+
38 def test_tr_description(self):
39 """
40 Verify that Provider1.tr_description() works as expected

Subscribers

People subscribed via source and target branches