~ubuntu-branches/ubuntu/trusty/ubuntuone-control-panel/trusty-proposed

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gui/qt/tests/test_share_links.py

  • Committer: Package Import Robot
  • Author(s): Rodney Dawes
  • Date: 2012-10-03 17:11:48 UTC
  • mfrom: (1.1.40)
  • Revision ID: package-import@ubuntu.com-20121003171148-d0p9tu9poeaxxf1g
Tags: 4.0.0-0ubuntu1
* New upstream release.
  - Accept mouse events for the shares tab search results. (LP: #1056192)
  - Fix some tests to be more multi-platform safe with filenames.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        self.assertEqual(self.ui.ui.stacked_widget.currentIndex(), 1)
79
79
        self.assertFalse(self.ui.is_processing)
80
80
 
 
81
    def test_file_already_shared(self):
 
82
        """Check the behavior of the widgets when there is a shared file."""
 
83
        data = []
 
84
 
 
85
        def fake_method(self, *args):
 
86
            """Fake callback."""
 
87
            data.append((args))
 
88
 
 
89
        self.patch(self.ui.backend, "change_public_access", fake_method)
 
90
        path = '/home/user/Ubuntu One/file1.txt'
 
91
        shared = {
 
92
            '/home/user/Ubuntu One/file1.txt': 'http://ubuntuone.com/asd123'}
 
93
        self.ui._shared_files = shared
 
94
        self.ui.share_file(path)
 
95
        self.assertEqual(self.ui.ui.line_copy_link.text(), shared[path])
 
96
        self.assertEqual(self.ui.ui.stacked_widget.currentIndex(), 1)
 
97
        self.assertEqual(data, [])
 
98
 
81
99
    def test_open_in_browser(self):
82
100
        """Test the execution of open_in_browser."""
83
101
        fake_desktop_service = FakeDesktopService()