~3v1n0/unity/bfb-quicklist-does-not-close-dash

« back to all changes in this revision

Viewing changes to tests/autopilot/unity/tests/test_dash.py

  • Committer: Tarmac
  • Author(s): Thomi Richards
  • Date: 2012-08-09 17:11:22 UTC
  • mfrom: (2529.7.1 fix-hangs)
  • Revision ID: tarmac-20120809171122-smkymvzmfqojj45e
Use the new clipboard emulator in autopilot. Fixes some hanging tests.. Fixes: . Approved by Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
from __future__ import absolute_import
10
10
 
11
 
from time import sleep
12
 
 
 
11
from autopilot.emulators.clipboard import get_clipboard_contents
13
12
from autopilot.matchers import Eventually
14
 
from gtk import Clipboard
15
13
from testtools.matchers import Equals, NotEquals
 
14
from time import sleep
16
15
 
17
16
from unity.tests import UnityTestCase
18
17
 
305
304
        self.keyboard.press_and_release("Ctrl+a")
306
305
        self.keyboard.press_and_release("Ctrl+c")
307
306
 
308
 
        cb = Clipboard(selection="CLIPBOARD")
309
 
        self.assertThat(self.dash.search_string, Eventually(Equals(cb.wait_for_text())))
 
307
        self.assertThat(get_clipboard_contents, Eventually(Equals("Copy")))
310
308
 
311
309
    def test_ctrl_x(self):
312
310
        """ This test if ctrl+x deletes all text and copys it """
319
317
        self.keyboard.press_and_release("Ctrl+x")
320
318
        self.assertThat(self.dash.search_string, Eventually(Equals("")))
321
319
 
322
 
        cb = Clipboard(selection="CLIPBOARD")
323
 
        self.assertEqual(cb.wait_for_text(), u'Cut')
 
320
        self.assertThat(get_clipboard_contents, Eventually(Equals('Cut')))
324
321
 
325
322
    def test_ctrl_c_v(self):
326
323
        """ This test if ctrl+c and ctrl+v copies and pastes text"""