From 5c98ccd70601c475f3bcb34e6a233069c9f542f6 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Tue, 22 Jun 2010 00:58:48 +0400 Subject: s4 python: Add unit tests related to PyLong/PyInt handling Signed-off-by: Jelmer Vernooij --- source4/scripting/python/samba/tests/dcerpc/unix.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/tests/dcerpc/unix.py b/source4/scripting/python/samba/tests/dcerpc/unix.py index bd1fd6d95f..4e1fe65ec5 100644 --- a/source4/scripting/python/samba/tests/dcerpc/unix.py +++ b/source4/scripting/python/samba/tests/dcerpc/unix.py @@ -26,14 +26,23 @@ class UnixinfoTests(RpcInterfaceTestCase): super(UnixinfoTests, self).setUp() self.conn = unixinfo.unixinfo("ncalrpc:", self.get_loadparm()) - def test_getpwuid(self): + def test_getpwuid_int(self): infos = self.conn.GetPWUid(range(512)) self.assertEquals(512, len(infos)) self.assertEquals("/bin/false", infos[0].shell) 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): - self.conn.GidToSid(1000) + self.conn.GidToSid(1000L) def test_uidtosid(self): self.conn.UidToSid(1000) + + def test_uidtosid_fail(self): + self.assertRaises(TypeError, self.conn.UidToSid, "100") -- cgit