summaryrefslogtreecommitdiffstats
path: root/tests/QtCore/qeasingcurve_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtCore/qeasingcurve_test.py')
-rw-r--r--tests/QtCore/qeasingcurve_test.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/QtCore/qeasingcurve_test.py b/tests/QtCore/qeasingcurve_test.py
new file mode 100644
index 0000000..77c0e6c
--- /dev/null
+++ b/tests/QtCore/qeasingcurve_test.py
@@ -0,0 +1,26 @@
+import unittest
+
+from PySide.QtCore import QEasingCurve
+
+def myFunction(progress):
+ if progress == 1.0:
+ return 100.0
+ else:
+ return -100.0
+
+class TestQEasingCurve(unittest.TestCase):
+ def testCustomType(self):
+ ec = QEasingCurve()
+ ec.setCustomType(myFunction)
+ self.assertEqual(ec.valueForProgress(1.0), 100.0)
+ self.assertEqual(ec.valueForProgress(0.5), -100.0)
+
+ def testObjectCleanup(self):
+ for i in range(100):
+ ec = QEasingCurve()
+ ec.setCustomType(myFunction)
+ self.assertEqual(ec.valueForProgress(1.0), 100.0)
+ self.assertEqual(ec.valueForProgress(0.5), -100.0)
+
+if __name__ == '__main__':
+ unittest.main()