summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-06-22 00:58:48 +0400
committerJelmer Vernooij <jelmer@samba.org>2010-06-25 11:33:33 +0200
commit5c98ccd70601c475f3bcb34e6a233069c9f542f6 (patch)
treef088e96275bec01f3811463d1e95daee05e880e4 /source4/scripting
parent3fc9675e93c3bfb3381b06bce3d2b130952e9026 (diff)
downloadsamba-5c98ccd70601c475f3bcb34e6a233069c9f542f6.tar.gz
samba-5c98ccd70601c475f3bcb34e6a233069c9f542f6.tar.bz2
samba-5c98ccd70601c475f3bcb34e6a233069c9f542f6.zip
s4 python: Add unit tests related to PyLong/PyInt handling
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/unix.py13
1 files changed, 11 insertions, 2 deletions
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")