blob: 4afbce941e085a6b0aa65094bf1c991efa8d59b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()
|