Adding qabs_test.py
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
3458562477
commit
8e8c65f888
1 changed files with 20 additions and 0 deletions
20
tests/qtcore/qabs_test.py
Normal file
20
tests/qtcore/qabs_test.py
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from PySide import QtCore
|
||||||
|
|
||||||
|
|
||||||
|
class QAbsTest(unittest.TestCase):
|
||||||
|
'''Tests for QtCore.qAbs'''
|
||||||
|
|
||||||
|
def testBasic(self):
|
||||||
|
def check(x):
|
||||||
|
self.assertEqual(QtCore.qAbs(x), abs(x))
|
||||||
|
|
||||||
|
check(0)
|
||||||
|
check(-10)
|
||||||
|
check(10)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue