Merge lp:~blueyed/apport/bug532944 into lp:~apport-hackers/apport/trunk

Proposed by Daniel Hahler
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~blueyed/apport/bug532944
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 45 lines (+17/-1)
2 files modified
NEWS (+1/-0)
apport/ui.py (+16/-1)
To merge this branch: bzr merge lp:~blueyed/apport/bug532944
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+20792@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

This was merged a long time ago already.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2010-03-05 15:48:31 +0000
3+++ NEWS 2010-03-05 23:27:20 +0000
4@@ -11,6 +11,7 @@
5 Bug fixes:
6 - Fix --help output for bug updating mode (invocation as apport-collect or
7 apport-update-bug). (LP: #504116)
8+ - Fix argument/options handling for "ubuntu-bug" (LP: #532944)
9
10 1.12.1 (2010-02-22)
11 -------------------
12
13=== modified file 'apport/ui.py'
14--- apport/ui.py 2010-03-05 15:48:31 +0000
15+++ apport/ui.py 2010-03-05 23:27:20 +0000
16@@ -619,7 +619,9 @@
17
18 # no argument: default to "show pending crashes" except when called in
19 # bug mode
20- if len(self.args) == 0 and cmd.endswith('-bug'):
21+ # NOTE: uses sys.argv, since self.args if empty for all the options,
22+ # e.g. "-v" or "-u $BUG"
23+ if len(sys.argv) == 1 and cmd.endswith('-bug'):
24 self.options.filebug = True
25 return
26
27@@ -1639,6 +1641,19 @@
28 self.assertEqual(self.ui.run_argv(), False)
29 self.assertEqual(self.ui.msg_severity, 'error')
30
31+ def test_run_version(self):
32+ '''run_report_bug() as "ubuntu-bug" with version argument.
33+ (LP: #532944)'''
34+
35+ sys.argv = ['ubuntu-bug', '-v']
36+ self.ui = _TestSuiteUserInterface()
37+ orig_stdout = sys.stdout
38+ sys.stdout = StringIO()
39+ self.assertEqual(self.ui.run_argv(), True)
40+ output = sys.stdout.getvalue()
41+ sys.stdout = orig_stdout
42+ self.assertEqual(output, __version__+"\n")
43+
44 def test_run_report_bug_package(self):
45 '''run_report_bug() for a package.'''
46

Subscribers

People subscribed via source and target branches