summaryrefslogtreecommitdiff
path: root/source4/libcli/security/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-11-29 15:08:22 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:46:47 +0100
commit4004de7b7dec06e7ee0040f8a07c7f4fb967a4c1 (patch)
tree6a9179ff4b2de2418733277a1fb9abe3bd701f37 /source4/libcli/security/tests
parentf2f16b45b58c2bbf3053ff55e7a290fc069e0efd (diff)
downloadsamba-4004de7b7dec06e7ee0040f8a07c7f4fb967a4c1.tar.gz
samba-4004de7b7dec06e7ee0040f8a07c7f4fb967a4c1.tar.bz2
samba-4004de7b7dec06e7ee0040f8a07c7f4fb967a4c1.zip
r26199: Allow constructing new sids, implement __eq__ for sids.
(This used to be commit 87472e35c04fdf0c61c9133bab3c05bda11eba00)
Diffstat (limited to 'source4/libcli/security/tests')
-rw-r--r--source4/libcli/security/tests/bindings.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/libcli/security/tests/bindings.py b/source4/libcli/security/tests/bindings.py
index 15e2381a2b..59a5e69640 100644
--- a/source4/libcli/security/tests/bindings.py
+++ b/source4/libcli/security/tests/bindings.py
@@ -50,7 +50,17 @@ class SecurityDescriptorTests(unittest.TestCase):
self.descriptor = security.SecurityDescriptor()
-class RandomSidTests(unittest.TestCase):
+class DomSidTests(unittest.TestCase):
+ def test_parse_sid(self):
+ sid = security.Sid("S-1-5-21")
+ self.assertEquals("S-1-5-21", str(sid))
+
+ def test_sid_equal(self):
+ sid1 = security.Sid("S-1-5-21")
+ sid2 = security.Sid("S-1-5-21")
+ self.assertTrue(sid1.__eq__(sid1))
+ self.assertTrue(sid1.__eq__(sid2))
+
def test_random(self):
sid = security.random_sid()
self.assertTrue(str(sid).startswith("S-1-5-21-"))