3
from sys import getrefcount
4
from PySide.QtCore import QBuffer
5
from PySide.QtSvg import QSvgGenerator
7
class QSvgGeneratorTest(unittest.TestCase):
9
def testRefCountOfTOutputDevice(self):
10
generator = QSvgGenerator()
12
refcount1 = getrefcount(iodevice1)
14
generator.setOutputDevice(iodevice1)
16
self.assertEqual(generator.outputDevice(), iodevice1)
17
self.assertEqual(getrefcount(generator.outputDevice()), refcount1 + 1)
20
refcount2 = getrefcount(iodevice2)
22
generator.setOutputDevice(iodevice2)
24
self.assertEqual(generator.outputDevice(), iodevice2)
25
self.assertEqual(getrefcount(generator.outputDevice()), refcount2 + 1)
26
self.assertEqual(getrefcount(iodevice1), refcount1)
30
self.assertEqual(getrefcount(iodevice2), refcount2)
32
if __name__ == '__main__':