Changed api2 test to work on MacOS during a ssh session.

This commit is contained in:
Renato Araujo Oliveira Filho 2010-12-29 11:55:09 -03:00 • committed by Hugo Parente Lima
commit 1d05357e26

View file

@ -2,6 +2,7 @@
import unittest import unittest
import sys
from PySide.QtCore import QObject from PySide.QtCore import QObject
from PySide.QtGui import * from PySide.QtGui import *
@ -38,23 +39,21 @@ class DoubleQObjectInheritanceTest(UsesQApplication):
obj.setRange(1, 10) obj.setRange(1, 10)
obj.setValue(0) obj.setValue(0)
print "Value:", obj.value() self.assertEqual(obj.value(), 1)
class QClipboardTest(UsesQApplication): class QClipboardTest(UsesQApplication):
def testQClipboard(self): def testQClipboard(self):
clip = QClipboard() #skip this test on MacOS because the clipboard is not available during the ssh session
#this cause problems in the buildbot
if sys.platform == 'darwin':
return
clip = QApplication.clipboard()
clip.setText("Testing this thing!") clip.setText("Testing this thing!")
text, subtype = clip.text("") text, subtype = clip.text("")
self.assertEqual(subtype, "plain") self.assertEqual(subtype, "plain")
self.assertEqual(text, "Testing this thing!") self.assertEqual(text, "Testing this thing!")
#class QFileDialog(UsesQApplication):
#
# def testQFileDialog(self):
# string, filtr = QFileDialog.getOpenFileName()
# print string, filtr
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()