aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCarlos Goncalves <mail@cgoncalves.info>2010-02-28 02:21:13 +0000
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-03-02 21:02:17 -0300
commit8bc7aa50c6e875461787ce9c6b5e2edb01de78bc (patch)
treea83614d46d878b849798a6c780bd0535e370a511 /tests
parent0d9b1dca7fcdae9ceb1d31c2f21926c2b06e7802 (diff)
Initial QtSvg bindings
Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtsvg/qsvggenerator_test.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/qtsvg/qsvggenerator_test.py b/tests/qtsvg/qsvggenerator_test.py
new file mode 100644
index 000000000..cec7fdaff
--- /dev/null
+++ b/tests/qtsvg/qsvggenerator_test.py
@@ -0,0 +1,34 @@
+#!/usr/bin/python
+import unittest
+from sys import getrefcount
+from PySide.QtCore import QBuffer
+from PySide.QtSvg import QSvgGenerator
+
+class QSvgGeneratorTest(unittest.TestCase):
+
+ def testRefCountOfTOutputDevice(self):
+ generator = QSvgGenerator()
+ iodevice1 = QBuffer()
+ refcount1 = getrefcount(iodevice1)
+
+ generator.setOutputDevice(iodevice1)
+
+ self.assertEqual(generator.outputDevice(), iodevice1)
+ self.assertEqual(getrefcount(generator.outputDevice()), refcount1 + 1)
+
+ iodevice2 = QBuffer()
+ refcount2 = getrefcount(iodevice2)
+
+ generator.setOutputDevice(iodevice2)
+
+ self.assertEqual(generator.outputDevice(), iodevice2)
+ self.assertEqual(getrefcount(generator.outputDevice()), refcount2 + 1)
+ self.assertEqual(getrefcount(iodevice1), refcount1)
+
+ del generator
+
+ self.assertEqual(getrefcount(iodevice2), refcount2)
+
+if __name__ == '__main__':
+ unittest.main()
+