Merge lp:~dobey/ubuntuone-installer/core-cache into lp:ubuntuone-installer

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 33
Merged at revision: 32
Proposed branch: lp:~dobey/ubuntuone-installer/core-cache
Merge into: lp:ubuntuone-installer
Diff against target: 52 lines (+24/-1)
2 files modified
ubuntuone/installer/gui.py (+2/-1)
ubuntuone/installer/tests/test_gui.py (+22/-0)
To merge this branch: bzr merge lp:~dobey/ubuntuone-installer/core-cache
Reviewer Review Type Date Requested Status
Mike McCracken (community) Approve
Eric Casteleijn (community) Approve
Review via email: mp+113286@code.launchpad.net

Commit message

Add a fake aptdaemon and fake transaction object to avoid annoying dbus errors
Pass only the system sources.list as the the list to use for updating the cache

To post a comment you must log in.
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Looks fine to me

review: Approve
Revision history for this message
Mike McCracken (mikemc) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone/installer/gui.py'
--- ubuntuone/installer/gui.py 2012-05-25 19:29:11 +0000
+++ ubuntuone/installer/gui.py 2012-07-03 19:54:18 +0000
@@ -406,7 +406,8 @@
406 else:406 else:
407 self.__install_u1()407 self.__install_u1()
408408
409 transaction = yield self.client.update_cache()409 transaction = yield self.client.update_cache(
410 sources_list='/etc/apt/sources.list')
410 transaction.connect('finished', finished)411 transaction.connect('finished', finished)
411 self.__apt_progress.set_transaction(transaction)412 self.__apt_progress.set_transaction(transaction)
412 transaction.run()413 transaction.run()
413414
=== modified file 'ubuntuone/installer/tests/test_gui.py'
--- ubuntuone/installer/tests/test_gui.py 2012-05-21 17:56:04 +0000
+++ ubuntuone/installer/tests/test_gui.py 2012-07-03 19:54:18 +0000
@@ -21,12 +21,34 @@
21from ubuntuone.installer import gui21from ubuntuone.installer import gui
2222
2323
24class FakeTransaction(object):
25 """Fake transaction object."""
26
27 def connect(self, *args, **kwargs):
28 """Fake signal connection."""
29
30 def run(self, *args, **kwargs):
31 """Fake runner."""
32
33
34class FakeAptClient(object):
35 """Fake client for apt."""
36
37 def __init__(self, *args, **kwargs):
38 super(FakeAptClient, self).__init__(*args, **kwargs)
39
40 def update_cache(self, *args, **kwargs):
41 """Fake update_cache call."""
42 return FakeTransaction()
43
44
24class GUITestCase(DBusTestCase):45class GUITestCase(DBusTestCase):
25 """Main class tests."""46 """Main class tests."""
2647
27 @inlineCallbacks48 @inlineCallbacks
28 def setUp(self):49 def setUp(self):
29 yield super(GUITestCase, self).setUp()50 yield super(GUITestCase, self).setUp()
51 self.patch(gui.aptclient, 'AptClient', FakeAptClient)
30 gui.Gtk.main_quit = lambda: None52 gui.Gtk.main_quit = lambda: None
31 gui.Gtk.main = lambda: None53 gui.Gtk.main = lambda: None
32 self.dlg = gui.Window()54 self.dlg = gui.Window()

Subscribers

People subscribed via source and target branches

to all changes: