~ubuntu-branches/ubuntu/oneiric/pyside/oneiric

« back to all changes in this revision

Viewing changes to tests/QtSvg/qsvggenerator_test.py

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2010-09-27 21:01:06 UTC
  • mfrom: (1.2.1 upstream) (6.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20100927210106-m1nrq8vmd3exqb9o
Tags: 0.4.1-0ubuntu1
* New 0.4.1 upstream release. (LP: #648612)
  - Add some 0.4.1 symbols.

* Patches:
  - u_c130273_fix_py25_QtScript_property.patch
    Remove, was from upstream.
  - u_20e226b_fix_missing_qcoreapplication_arguments_method.patch
    Remove, was from upstream.
  - u_268bf77_fixed_signal_signature_parser.patch
    Remove, was from upstream.
  + libPythonVersionPostfix.patch: Refresh
  + usePySpecificShiboken.patch: Refresh
  + lessBuildVerbosity.patch: Refresh

* Bump the B-D chain versions.
* Make sure the private.py is installed in QtCore module.
* Build against Qt 4.7.
  - Add libqtwebkit-dev
  - Drop QtMultimedia module.
  - Add the QtDeclarative package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
import unittest
 
3
from sys import getrefcount
 
4
from PySide.QtCore import QBuffer
 
5
from PySide.QtSvg import QSvgGenerator
 
6
 
 
7
class QSvgGeneratorTest(unittest.TestCase):
 
8
 
 
9
    def testRefCountOfTOutputDevice(self):
 
10
        generator = QSvgGenerator()
 
11
        iodevice1 = QBuffer()
 
12
        refcount1 = getrefcount(iodevice1)
 
13
 
 
14
        generator.setOutputDevice(iodevice1)
 
15
 
 
16
        self.assertEqual(generator.outputDevice(), iodevice1)
 
17
        self.assertEqual(getrefcount(generator.outputDevice()), refcount1 + 1)
 
18
 
 
19
        iodevice2 = QBuffer()
 
20
        refcount2 = getrefcount(iodevice2)
 
21
 
 
22
        generator.setOutputDevice(iodevice2)
 
23
 
 
24
        self.assertEqual(generator.outputDevice(), iodevice2)
 
25
        self.assertEqual(getrefcount(generator.outputDevice()), refcount2 + 1)
 
26
        self.assertEqual(getrefcount(iodevice1), refcount1)
 
27
 
 
28
        del generator
 
29
 
 
30
        self.assertEqual(getrefcount(iodevice2), refcount2)
 
31
 
 
32
if __name__ == '__main__':
 
33
    unittest.main()
 
34