Merge lp:~mvo/gdebi/test-fixes into lp:gdebi

Proposed by Michael Vogt
Status: Merged
Merged at revision: 463
Proposed branch: lp:~mvo/gdebi/test-fixes
Merge into: lp:gdebi
Diff against target: 102 lines (+17/-11)
5 files modified
GDebi/GDebiCommon.py (+7/-6)
GDebi/GDebiKDE.py (+1/-1)
debian/control (+2/-1)
debian/rules (+3/-1)
tests/test_gdebi_gtk_lintian.py (+4/-2)
To merge this branch: bzr merge lp:~mvo/gdebi/test-fixes
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Pending
gdebi-developers Pending
Review via email: mp+208922@code.launchpad.net

Description of the change

This branch fixes a testfailure during build and uses "python setup.py test" to run the tests.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Hm, in sbuild I get a test error:
======================================================================
ERROR: test_lintian (tests.test_gdebi_gtk_lintian.GDebiGtkTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock.py", line 1210, in patched
    return func(*args, **keywargs)
  File "/«PKGBUILDDIR»/tests/test_gdebi_gtk_lintian.py", line 51, in test_lintian
    if gdebi._lintian_exit_status is not None:
AttributeError: 'GDebiGtk' object has no attribute '_lintian_exit_status'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GDebi/GDebiCommon.py'
2--- GDebi/GDebiCommon.py 2014-02-28 22:11:44 +0000
3+++ GDebi/GDebiCommon.py 2014-03-01 08:24:22 +0000
4@@ -36,7 +36,13 @@
5 )
6
7
8-if sys.version_info[0] == 2:
9+if sys.version_info[0] == 3:
10+ from gettext import gettext as _
11+ def py3utf8(s):
12+ return s
13+ utf8 = py3utf8
14+ unicode = str
15+else:
16 def _(str):
17 return utf8(gettext.gettext(str))
18
19@@ -50,11 +56,6 @@
20 # assume latin1 as fallback
21 return unicode(str, 'latin1')
22 utf8 = py2utf8
23-else:
24- from gettext import gettext as _
25- def py3utf8(s):
26- return s
27- utf8 = py3utf8
28
29
30 class GDebiCommon(object):
31
32=== modified file 'GDebi/GDebiKDE.py'
33--- GDebi/GDebiKDE.py 2014-01-02 13:43:12 +0000
34+++ GDebi/GDebiKDE.py 2014-03-01 08:24:22 +0000
35@@ -65,7 +65,7 @@
36
37
38 def __(catalog,str):
39- return unicode(gettext.dgettext(catalog, str), 'UTF-8')
40+ return utf8(gettext.dgettext(catalog, str))
41
42 def loadUi(file, parent):
43 """load local file if possible else use installed file"""
44
45=== modified file 'debian/control'
46--- debian/control 2014-01-02 13:35:07 +0000
47+++ debian/control 2014-03-01 08:24:22 +0000
48@@ -15,7 +15,8 @@
49 python-setuptools,
50 intltool,
51 xvfb,
52- xauth
53+ xauth,
54+ pyflakes
55 X-Python-Version: >= 2.6
56 Standards-Version: 3.9.5
57 Vcs-Bzr: https://code.launchpad.net/~gdebi-developers/gdebi/trunk
58
59=== modified file 'debian/rules'
60--- debian/rules 2014-02-28 22:12:29 +0000
61+++ debian/rules 2014-03-01 08:24:22 +0000
62@@ -1,5 +1,7 @@
63 #!/usr/bin/make -f
64
65+PYTHON=python2
66+
67 %:
68 dh $@ --with python2
69
70@@ -8,7 +10,7 @@
71 rm -rf build GDebi/Version.py po/mo
72
73 override_dh_auto_test:
74- xvfb-run -a nosetests
75+ xvfb-run -a $(PYTHON) setup.py test
76
77 override_dh_auto_install:
78 dh_auto_install -- --install-scripts=/usr/share/gdebi \
79
80=== modified file 'tests/test_gdebi_gtk_lintian.py'
81--- tests/test_gdebi_gtk_lintian.py 2012-11-30 19:39:34 +0000
82+++ tests/test_gdebi_gtk_lintian.py 2014-03-01 08:24:22 +0000
83@@ -10,7 +10,8 @@
84 from GDebi.GDebiGtk import GDebiGtk
85 from GDebi.GDebiCommon import GDebiCommon
86
87-EXPECTED_LINTIAN_OUTPUT = """E: error-package: file-in-etc-not-marked-as-conffile etc/foo
88+EXPECTED_LINTIAN_OUTPUT = """E: error-package: changelog-file-missing-in-native-package
89+E: error-package: file-in-etc-not-marked-as-conffile etc/foo
90 E: error-package: control-file-has-bad-owner postinst egon/egon != root/root
91 E: error-package: no-copyright-file
92 E: error-package: package-has-no-description
93@@ -56,7 +57,8 @@
94 start = buf.get_start_iter()
95 end = buf.get_end_iter()
96 lintian_output = buf.get_text(start, end, False)
97- self.assertEqual(lintian_output.strip(), EXPECTED_LINTIAN_OUTPUT)
98+ self.maxDiff = None
99+ self.assertMultiLineEqual(lintian_output.strip(), EXPECTED_LINTIAN_OUTPUT)
100
101
102 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches

to status/vote changes: