aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-08-20 18:34:06 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-08-23 10:54:53 -0300
commite0fc2c6517981c1a03952eb4d039bd122a8e617d (patch)
tree0cc7f44028fcad33d79aaa48d7d569950a7675fa /tests
parent4dd52c399630cfaa6c1a660f4883478add0ce43b (diff)
Fixed use of QFile to works on all plataforms.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/qflags_test.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/QtCore/qflags_test.py b/tests/QtCore/qflags_test.py
index 1346c11ef..8b3a48816 100644
--- a/tests/QtCore/qflags_test.py
+++ b/tests/QtCore/qflags_test.py
@@ -2,13 +2,18 @@
'''Test cases for QFlags'''
import unittest
-from PySide.QtCore import QIODevice, Qt, QFile
+from PySide.QtCore import QIODevice, Qt, QFile, QTemporaryFile
class QFlagTest(unittest.TestCase):
'''Test case for usage of flags'''
def testCallFunction(self):
- f = QFile("/tmp/t0");
+ f = QTemporaryFile()
+ self.assert_(f.open())
+ fileName = f.fileName()
+ f.close()
+
+ f = QFile(fileName)
self.assertEqual(f.open(QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite), True)
om = f.openMode()
self.assertEqual(om & QIODevice.Truncate, QIODevice.Truncate)