aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-07-20 17:48:15 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:37 -0300
commite3539a09a8c6fdcea1ad3029c8f85f81e303e6ff (patch)
tree8916f47636f08603d5f907c6f2c7ac1204c9e939 /tests
parentef45b5a924b921628c1bc3fd7fce18c994430208 (diff)
Fix bug 821 - "Mapping interface for QPixmapCache"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtGui/qpixmapcache_test.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/QtGui/qpixmapcache_test.py b/tests/QtGui/qpixmapcache_test.py
index 33d631b92..68b4d928f 100644
--- a/tests/QtGui/qpixmapcache_test.py
+++ b/tests/QtGui/qpixmapcache_test.py
@@ -10,6 +10,8 @@ class QPixmapCacheTest(UsesQApplication):
ok = QPixmapCache.find('img', pm1)
self.assertFalse(ok)
+ self.assertEqual(QPixmapCache.find('img'), None)
+
pm2 = QPixmap()
ok = QPixmapCache.insert('img', pm2)
self.assertTrue(ok)
@@ -18,11 +20,15 @@ class QPixmapCacheTest(UsesQApplication):
ok = QPixmapCache.find('img', pm3)
self.assertTrue(ok)
+ self.assertEqual(QPixmapCache.find('img').toImage().bits(), pm3.toImage().bits())
+
def testWithKey(self):
pm1 = QPixmap()
ok = QPixmapCache.find(QPixmapCache.Key(), pm1)
self.assertFalse(ok)
+ self.assertEqual(QPixmapCache.find(QPixmapCache.Key()), None)
+
pm2 = QPixmap()
key = QPixmapCache.insert(pm2)
@@ -30,6 +36,7 @@ class QPixmapCacheTest(UsesQApplication):
ok = QPixmapCache.find(key, pm3)
self.assertTrue(ok)
+ self.assertEqual(QPixmapCache.find(key).toImage().bits(), pm3.toImage().bits())
if __name__ == '__main__':
unittest.main()