diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-11-05 11:05:56 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-11-05 17:15:13 -0200 |
commit | a029d217c2ae26aedb89e472ccdf61d20ec7fd26 (patch) | |
tree | 703b576189bae85486aa1d62bb0c1ca906e82b94 /tests/QtSvg/qsvgwidget_test.py | |
parent | 50f915572de1f6f492f80b2cfc8c8fedd9cdae6f (diff) |
Fix bug#427 - "QSvgWidget, load from QtCore.QByteArray does not work"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'tests/QtSvg/qsvgwidget_test.py')
-rw-r--r-- | tests/QtSvg/qsvgwidget_test.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/QtSvg/qsvgwidget_test.py b/tests/QtSvg/qsvgwidget_test.py new file mode 100644 index 000000000..4afbce941 --- /dev/null +++ b/tests/QtSvg/qsvgwidget_test.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +import unittest, os +from PySide.QtCore import * +from PySide.QtGui import * +from PySide.QtSvg import * + +class QSvgWidgetTest(unittest.TestCase): + + def testLoad(self): + tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg') + + app = QApplication([]) + fromFile = QSvgWidget() + fromFile.load(tigerPath) + self.assertTrue(fromFile.renderer().isValid()) + + tigerFile = QFile(tigerPath) + tigerFile.open(QFile.ReadOnly) + tigerData = tigerFile.readAll() + fromContents = QSvgWidget() + fromContents.load(tigerData) + self.assertTrue(fromContents.renderer().isValid()) + +if __name__ == '__main__': + unittest.main() + |