summaryrefslogtreecommitdiffstats
path: root/tests/QtCore/qabs_test.py
blob: 37ff9c7cdcc75e4acf2eb13214aca9ab256b6338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
        check(10.5)
        check(-10.5)

if __name__ == '__main__':
    unittest.main()