~ubuntu-branches/ubuntu/natty/pyside/natty-proposed

« back to all changes in this revision

Viewing changes to tests/QtGui/api2_test.py

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2011-02-18 18:01:00 UTC
  • mfrom: (1.2.3 upstream) (6.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110218180100-vaczjij7g08fzfme
Tags: 1.0.0~rc1-1
* New 1.0.0~rc1 upstream release
  - Bump the B-D chain versions:
    + apiextractor to 0.10.0-2~
    + generatorrunner to 0.6.6
    + shiboken to 1.0.0~rc1
* Update patches to ~rc1.
* debian/watch: update to handle Release Candidates too.
* Bump XS-Python-Version to >= 2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
 
4
4
import unittest
 
5
import sys
5
6
 
6
7
from PySide.QtCore import QObject
7
8
from PySide.QtGui import *
38
39
 
39
40
        obj.setRange(1, 10)
40
41
        obj.setValue(0)
41
 
        print "Value:", obj.value()
 
42
        self.assertEqual(obj.value(), 1)
42
43
 
43
44
class QClipboardTest(UsesQApplication):
44
45
 
45
46
    def testQClipboard(self):
46
 
        clip = QClipboard()
 
47
        #skip this test on MacOS because the clipboard is not available during the ssh session
 
48
        #this cause problems in the buildbot
 
49
        if sys.platform == 'darwin':
 
50
            return
 
51
        clip = QApplication.clipboard()
47
52
        clip.setText("Testing this thing!")
48
53
 
49
54
        text, subtype = clip.text("")
50
55
        self.assertEqual(subtype, "plain")
51
56
        self.assertEqual(text, "Testing this thing!")
52
57
 
53
 
#class QFileDialog(UsesQApplication):
54
 
#
55
 
#    def testQFileDialog(self):
56
 
#        string, filtr = QFileDialog.getOpenFileName()
57
 
#        print string, filtr
58
 
 
59
58
if __name__ == '__main__':
60
59
    unittest.main()