Merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-publishapi into lp:ubuntuone-control-panel

Proposed by Diego Sarmentero on 2012-10-05
Status: Merged
Approved by: dobey on 2012-10-15
Approved revision: 366
Merged at revision: 368
Proposed branch: lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-publishapi
Merge into: lp:ubuntuone-control-panel
Diff against target: 74 lines (+18/-7)
2 files modified
ubuntuone/controlpanel/gui/qt/share_links.py (+6/-7)
ubuntuone/controlpanel/gui/qt/tests/test_share_links.py (+12/-0)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-publishapi
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2012-10-11
Mike McCracken (community) 2012-10-05 Approve on 2012-10-09
Review via email: mp+128316@code.launchpad.net

Commit message

- Move signals connection because they get deleted after they are emitted.

To post a comment you must log in.
Mike McCracken (mikemc) wrote :

For the next reviewer - to test this IRL, run control-panel and check that you can share one file and then a second. Without this branch, you can share one file but not a second.

review: Approve
Manuel de la Peña (mandel) wrote :

Is this fix still needed? WE already have lists for the handlers in trunk AFAIK.

review: Needs Fixing
review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (221.9 KiB)

The attempt to merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-publishapi into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

*** Running DBus test suite ***
ubuntuone.controlpanel.dbustests.test_dbus_service
  BaseTestCase
    runTest ... [OK]
  DBusServiceMainTestCase
    test_dbus_service_cant_register ... Control panel backend already running.
                                   [OK]
    test_dbus_service_main ... [OK]
  DBusServiceTestCase
    test_cant_register_twice ... [SKIPPED]
    test_dbus_busname_created ... [OK]
    test_error_handler_default ... [OK]
    test_error_handler_with_exception ... [OK]
    test_error_handler_with_failure ... [OK]
    test_error_handler_with_non_string_dict ... [OK]
    test_error_handler_with_string_dict ... [OK]
    test_register_service ... [OK]
  FileSyncTestCase
    test_file_sync_status_changed ... [OK]
    test_file_sync_status_disabled ... [OK]
    test_file_sync_status_disconnected ... [OK]
    test_file_sync_status_error ... [OK]
    test_file_sync_status_idle ... [OK]
    test_file_sync_status_starting ... [OK]
    test_file_sync_status_stopped ... [OK]
    test_file_sync_status_syncing ... [OK]
    test_file_sync_status_unknown ... [OK]
    test_status_changed_handler ... [OK]
    test_status_changed_handler_after_status_requested ... [OK]
    test_status_changed_handler_after_status_requested_twice ... [OK]
  OperationsAuthErrorTestCase
    test_account_info_returned ... [OK]
    test_change_device_settings ... [OK]
    test_change_replication_settings ... [OK]
    test_change_volume_settings ... [OK]
    test_connect_files ... [OK]
    test_devices_info_returned ... [OK]
    test_disable_files ... [OK]
    test_disconnect_files ... [OK]
    test_enable_files ... [OK]
    test_remove_device ... [OK]
    test_replications_info ... [OK]
    test_restart_files ... [OK]
...

Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (222.0 KiB)

The attempt to merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-publishapi into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

*** Running DBus test suite ***
ubuntuone.controlpanel.dbustests.test_dbus_service
  BaseTestCase
    runTest ... [OK]
  DBusServiceMainTestCase
    test_dbus_service_cant_register ... Control panel backend already running.
                                   [OK]
    test_dbus_service_main ... [OK]
  DBusServiceTestCase
    test_cant_register_twice ... [SKIPPED]
    test_dbus_busname_created ... [OK]
    test_error_handler_default ... [OK]
    test_error_handler_with_exception ... [OK]
    test_error_handler_with_failure ... [OK]
    test_error_handler_with_non_string_dict ... [OK]
    test_error_handler_with_string_dict ... [OK]
    test_register_service ... [OK]
  FileSyncTestCase
    test_file_sync_status_changed ... [OK]
    test_file_sync_status_disabled ... [OK]
    test_file_sync_status_disconnected ... [OK]
    test_file_sync_status_error ... [OK]
    test_file_sync_status_idle ... [OK]
    test_file_sync_status_starting ... [OK]
    test_file_sync_status_stopped ... [OK]
    test_file_sync_status_syncing ... [OK]
    test_file_sync_status_unknown ... [OK]
    test_status_changed_handler ... [OK]
    test_status_changed_handler_after_status_requested ... [OK]
    test_status_changed_handler_after_status_requested_twice ... [OK]
  OperationsAuthErrorTestCase
    test_account_info_returned ... [OK]
    test_change_device_settings ... [OK]
    test_change_replication_settings ... [OK]
    test_change_volume_settings ... [OK]
    test_connect_files ... [OK]
    test_devices_info_returned ... [OK]
    test_disable_files ... [OK]
    test_disconnect_files ... [OK]
    test_enable_files ... [OK]
    test_remove_device ... [OK]
    test_replications_info ... [OK]
    test_restart_files ... [OK]
...

366. By Diego Sarmentero on 2012-10-15

removing qthread refactor

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/qt/share_links.py'
2--- ubuntuone/controlpanel/gui/qt/share_links.py 2012-10-15 14:12:20 +0000
3+++ ubuntuone/controlpanel/gui/qt/share_links.py 2012-10-15 14:41:20 +0000
4@@ -90,16 +90,14 @@
5 self.ui.tree_shared_files.itemDoubleClicked.connect(
6 self._open_properties_selected_file)
7
8- # Connect backend signals
9- self.backend.set_public_files_list_handler(self._load_public_files)
10+ self.get_public_files()
11+
12+ @inlineCallbacks
13+ def share_file(self, file_path):
14+ """Clean the previous file share details and publish file_path."""
15 self.backend.set_public_access_changed_handler(self._file_shared)
16 self.backend.set_public_access_change_error_handler(
17 lambda: self._set_is_processing(False))
18- self.get_public_files()
19-
20- @inlineCallbacks
21- def share_file(self, file_path):
22- """Clean the previous file share details and publish file_path."""
23 file_path = unicode(file_path)
24 if self.ui.hbox_share_file.count() > 0:
25 widget = self.ui.hbox_share_file.takeAt(0).widget()
26@@ -156,6 +154,7 @@
27 @inlineCallbacks
28 def get_public_files(self):
29 """Request the list of public files."""
30+ self.backend.set_public_files_list_handler(self._load_public_files)
31 self.is_processing = True
32 self.home_dir = yield self.backend.get_home_dir()
33 yield self.backend.get_public_files()
34
35=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_share_links.py'
36--- ubuntuone/controlpanel/gui/qt/tests/test_share_links.py 2012-10-15 14:12:20 +0000
37+++ ubuntuone/controlpanel/gui/qt/tests/test_share_links.py 2012-10-15 14:41:20 +0000
38@@ -55,6 +55,11 @@
39
40 def test_share_file(self):
41 """Check that the state of the widgets on share_file."""
42+ data = []
43+ self.patch(self.ui.backend, "set_public_access_changed_handler",
44+ data.append)
45+ self.patch(self.ui.backend, "set_public_access_change_error_handler",
46+ data.append)
47 path = '/home/user/Ubuntu One/file1.txt'
48 self.ui.share_file(path)
49 self.assertTrue(self.ui.is_processing)
50@@ -63,6 +68,8 @@
51 self.assertEqual(widget.ui.lbl_filename.text(),
52 os.path.basename(path))
53 self.assertEqual(widget.ui.lbl_path.text(), path)
54+ self.assertEqual(len(data), 2)
55+ self.assertEqual(data[0], self.ui._file_shared)
56
57 def test_share_file_actions(self):
58 """Check the behaviour of share_file buttons."""
59@@ -125,10 +132,15 @@
60
61 def test_get_public_files(self):
62 """Test that the proper actions are executed on files requested.."""
63+ data = []
64+ self.patch(self.ui.backend, "set_public_files_list_handler",
65+ data.append)
66 self.ui.get_public_files()
67 self.assertTrue(self.ui.is_processing)
68 self.assertEqual(self.ui.ui.stacked_widget.currentIndex(), 0)
69 self.assertEqual(self.ui.home_dir, USER_HOME)
70+ self.assertEqual(len(data), 1)
71+ self.assertEqual(data[0], self.ui._load_public_files)
72
73 def test_line_close_btn(self):
74 """Check that the popup is hidden."""

Subscribers

People subscribed via source and target branches