File: config_test.py

package info (click to toggle)
libuser 1%3A0.62~dfsg-0.4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,736 kB
  • sloc: ansic: 16,082; sh: 13,091; python: 2,442; yacc: 782; makefile: 231; sed: 16
file content (26 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import libuser
import unittest

LARGE_ID = 2147483648

class Tests(unittest.TestCase):
    def setUp(self):
        self.a = libuser.admin()

    def testGetFirstUnusedUid(self):
        self.assertEqual(self.a.getFirstUnusedUid(start=LARGE_ID + 100),
                         LARGE_ID + 100)
        self.assertEqual(self.a.getFirstUnusedUid(), 1239)

    def testGetFirstUnusedGid(self):
        self.assertEqual(self.a.getFirstUnusedGid(start=LARGE_ID + 200),
                         LARGE_ID + 200)
        self.assertEqual(self.a.getFirstUnusedGid(), 1234)


    def tearDown(self):
        del self.a


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