mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
s4 python: Add unit tests related to PyLong/PyInt handling
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
This commit is contained in:
committed by
Jelmer Vernooij
parent
3fc9675e93
commit
5c98ccd706
@ -26,14 +26,23 @@ class UnixinfoTests(RpcInterfaceTestCase):
|
|||||||
super(UnixinfoTests, self).setUp()
|
super(UnixinfoTests, self).setUp()
|
||||||
self.conn = unixinfo.unixinfo("ncalrpc:", self.get_loadparm())
|
self.conn = unixinfo.unixinfo("ncalrpc:", self.get_loadparm())
|
||||||
|
|
||||||
def test_getpwuid(self):
|
def test_getpwuid_int(self):
|
||||||
infos = self.conn.GetPWUid(range(512))
|
infos = self.conn.GetPWUid(range(512))
|
||||||
self.assertEquals(512, len(infos))
|
self.assertEquals(512, len(infos))
|
||||||
self.assertEquals("/bin/false", infos[0].shell)
|
self.assertEquals("/bin/false", infos[0].shell)
|
||||||
self.assertTrue(isinstance(infos[0].homedir, unicode))
|
self.assertTrue(isinstance(infos[0].homedir, unicode))
|
||||||
|
|
||||||
|
def test_getpwuid(self):
|
||||||
|
infos = self.conn.GetPWUid(map(long, range(512)))
|
||||||
|
self.assertEquals(512, len(infos))
|
||||||
|
self.assertEquals("/bin/false", infos[0].shell)
|
||||||
|
self.assertTrue(isinstance(infos[0].homedir, unicode))
|
||||||
|
|
||||||
def test_gidtosid(self):
|
def test_gidtosid(self):
|
||||||
self.conn.GidToSid(1000)
|
self.conn.GidToSid(1000L)
|
||||||
|
|
||||||
def test_uidtosid(self):
|
def test_uidtosid(self):
|
||||||
self.conn.UidToSid(1000)
|
self.conn.UidToSid(1000)
|
||||||
|
|
||||||
|
def test_uidtosid_fail(self):
|
||||||
|
self.assertRaises(TypeError, self.conn.UidToSid, "100")
|
||||||
|
Reference in New Issue
Block a user