~ubuntu-branches/ubuntu/utopic/ubuntuone-control-panel/utopic

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Rodney Dawes
  • Date: 2012-09-18 15:22:02 UTC
  • mfrom: (1.1.39)
  • Revision ID: package-import@ubuntu.com-20120918152202-no7gxgkqy7a5zjj2
Tags: 3.99.92-0ubuntu1
* New upstream release.
  - Fix handling of space characters in share tab searching. (LP: #1042806)

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        self.assertTrue(self.ui.isEnabled())
74
74
 
75
75
    def test_key_down_pressed(self):
76
 
        """Check the proper action are executed on key down pressed."""
 
76
        """Check the proper actions are executed on key down pressed."""
77
77
        data1 = [{'path': 'folder1'}]
78
78
        data2 = [{'realpath': 'folder2'}]
79
79
        self.ui._process_volumes_info([(0, 0, data1), (0, 0, data2)])
83
83
        self.assertEqual(self.ui.popup.list_widget.currentRow(), 2)
84
84
 
85
85
    def test_key_down_pressed_load_more_items(self):
86
 
        """Check the proper action are executed on key down pressed."""
 
86
        """Check the proper actions are executed on key down pressed."""
87
87
        data = []
88
88
 
89
89
        def fake_fetch_more(filenames):
105
105
        self.assertEqual(data, [True])
106
106
 
107
107
    def test_key_up_pressed(self):
108
 
        """Check the proper action are executed on key up pressed."""
 
108
        """Check the proper actions are executed on key up pressed."""
109
109
        data1 = [{'path': 'folder1'}]
110
110
        data2 = [{'realpath': 'folder2'}]
111
111
        self.ui._process_volumes_info([(0, 0, data1), (0, 0, data2)])
115
115
        self.assertEqual(self.ui.popup.list_widget.currentRow(), 0)
116
116
 
117
117
    def test_key_up_pressed_stay_in_0(self):
118
 
        """Check the proper action are executed on key up pressed."""
 
118
        """Check the proper actions are executed on key up pressed."""
119
119
        data1 = [{'path': 'folder1'}]
120
120
        data2 = [{'realpath': 'folder2'}]
121
121
        self.ui._process_volumes_info([(0, 0, data1), (0, 0, data2)])
126
126
        self.assertEqual(self.ui.popup.list_widget.currentRow(), 0)
127
127
 
128
128
    def test_key_return_pressed(self):
129
 
        """Check the proper action are executed on key return pressed."""
 
129
        """Check the proper actions are executed on key return pressed."""
130
130
        data1 = [{'path': 'folder1'}]
131
131
        data2 = [{'realpath': 'folder2'}]
132
132
        self.ui._process_volumes_info([(0, 0, data1), (0, 0, data2)])
135
135
        self.ui._key_return_pressed(current)
136
136
 
137
137
    def test_key_space_pressed(self):
138
 
        """Check the proper action are executed on key space pressed."""
 
138
        """Check the proper actions are executed on key space pressed."""
139
139
        data = []
140
140
 
141
141
        def fake_set_text(text):
152
152
        expected = ['iop']
153
153
        self.assertEqual(expected, data)
154
154
 
 
155
    def test_key_space_pressed_without_selection(self):
 
156
        """Check the proper actions are executed on key space pressed."""
 
157
        self.ui.popup.list_widget.setCurrentItem(None)
 
158
        self.assertFalse(self.ui._key_space_pressed())
 
159
 
155
160
    def test_process_volumes_info(self):
156
161
        """Check that _process_volumes_info obtain the proper info."""
157
162
        data1 = [{'path': 'folder1'}]