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

« back to all changes in this revision

Viewing changes to tests/qtgui/float_to_int_implicit_conversion_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
 
 
2
 
'''Test cases for QImage'''
3
 
 
4
 
import unittest
5
 
 
6
 
from PySide.QtGui import QImage, qRgb
7
 
 
8
 
from helper import UsesQApplication
9
 
 
10
 
class SetPixelFloat(UsesQApplication):
11
 
    '''Test case for calling setPixel with float as argument'''
12
 
 
13
 
    def setUp(self):
14
 
        #Acquire resources
15
 
        super(SetPixelFloat, self).setUp()
16
 
        self.color = qRgb(255, 0, 0)
17
 
        self.image = QImage(200, 200, QImage.Format_RGB32)
18
 
 
19
 
    def tearDown(self):
20
 
        #Release resources
21
 
        del self.color
22
 
        del self.image
23
 
        super(SetPixelFloat, self).tearDown()
24
 
 
25
 
    def testFloat(self):
26
 
        #QImage.setPixel(float, float, color) - Implicit conversion
27
 
        self.image.setPixel(3.14, 4.2, self.color)
28
 
        self.assertEqual(self.image.pixel(3.14, 4.2), self.color)
29
 
 
30
 
 
31
 
if __name__ == '__main__':
32
 
    unittest.main()