Merge lp:~laney/software-center/misc-small-fixes into lp:software-center

Proposed by Iain Lane
Status: Merged
Approved by: dobey
Approved revision: 3312
Merged at revision: 3309
Proposed branch: lp:~laney/software-center/misc-small-fixes
Merge into: lp:software-center
Diff against target: 50 lines (+4/-3)
4 files modified
softwarecenter/config.py (+1/-1)
softwarecenter/utils.py (+0/-1)
tests/test_addons.py (+1/-1)
tests/test_xapian.py (+2/-0)
To merge this branch: bzr merge lp:~laney/software-center/misc-small-fixes
Reviewer Review Type Date Requested Status
dobey Approve
Michael Vogt Approve
Review via email: mp+173740@code.launchpad.net

Commit message

- Don't use super() when not using a "new-style" class (not derived from object)
- Don't free IconViews
- Update a test which uses live archive data to be consistent with reality
- test_xapian: Make the directory to hold the index if we need to

Description of the change

Some small easy-ish fixes which I noticed while trying to make the tests pass again.

The super() thing I learned from http://stackoverflow.com/questions/489269/python-super-raises-typeerror-why

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, this looks good. Please also add a commit message.

review: Approve
Revision history for this message
Iain Lane (laney) wrote :

Hope multiline commit messages are ok.

btw, I pinged dobey about the remaining failed tests and he advised me to disable any that aren't trivially fixable since nobody is really working on s-c ATM. Do you think that's sensible?

Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There was a problem validating some authors of the branch. Authors must be either one of the listed Launchpad users, or a member of one of the listed teams on Launchpad.

Persons or Teams:

    contributor-agreement-canonical
    software-store-developers

Unaccepted Authors:

    Iain Lane <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/config.py'
2--- softwarecenter/config.py 2013-07-05 20:18:26 +0000
3+++ softwarecenter/config.py 2013-07-09 14:40:38 +0000
4@@ -35,7 +35,7 @@
5 SECTIONS = ("general", "reviews")
6
7 def __init__(self, config):
8- super(SoftwareCenterConfig, self).__init__()
9+ SafeConfigParser.__init__(self)
10 # imported here to avoid cycle
11 from utils import safe_makedirs
12 safe_makedirs(os.path.dirname(config))
13
14=== modified file 'softwarecenter/utils.py'
15--- softwarecenter/utils.py 2012-12-06 16:16:49 +0000
16+++ softwarecenter/utils.py 2013-07-09 14:40:38 +0000
17@@ -487,7 +487,6 @@
18 icon_info = icons.lookup_icon(Icons.MISSING_APP, iconsize, 0)
19 if icon_info is not None:
20 icon_file_path = icon_info.get_filename()
21- icon_info.free()
22 return icon_file_path
23
24
25
26=== modified file 'tests/test_addons.py'
27--- tests/test_addons.py 2012-12-13 15:34:16 +0000
28+++ tests/test_addons.py 2013-07-09 14:40:38 +0000
29@@ -38,7 +38,7 @@
30 def test_enhances(self):
31 """Ensure that 'Enhances:' are picked up correctly """
32 res = self.cache.get_addons("powerwake")
33- self.assertEqual(res, ([], ["powernap"]))
34+ self.assertEqual(res, ([], ["powernap", "powerwaked"]))
35
36 def test_enhances_with_virtual_pkgs(self):
37 res = self.cache.get_addons("bibletime")
38
39=== modified file 'tests/test_xapian.py'
40--- tests/test_xapian.py 2012-08-23 15:01:40 +0000
41+++ tests/test_xapian.py 2013-07-09 14:40:38 +0000
42@@ -23,6 +23,8 @@
43 # but for now that does not matter that much, only if we
44 # call open the db is actually read and the path checked
45 pathname = os.path.join(REAL_DATA_DIR, "xapian")
46+ if not os.path.exists(pathname):
47+ os.makedirs(pathname)
48 if not os.listdir(pathname):
49 rebuild_database(pathname)
50 self.xapiandb = xapian.Database(pathname)