summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/misc.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/dcerpc/misc.py b/source4/scripting/python/samba/tests/dcerpc/misc.py
index d9a5573980..e9b5127a5a 100644
--- a/source4/scripting/python/samba/tests/dcerpc/misc.py
+++ b/source4/scripting/python/samba/tests/dcerpc/misc.py
@@ -24,6 +24,7 @@ text1 = "76f53846-a7c2-476a-ae2c-20e2b80d7b34"
text2 = "344edffa-330a-4b39-b96e-2c34da52e8b1"
class GUIDTests(unittest.TestCase):
+
def test_str(self):
guid = misc.GUID(text1)
self.assertEquals(text1, str(guid))
@@ -46,3 +47,18 @@ class GUIDTests(unittest.TestCase):
+class PolicyHandleTests(unittest.TestCase):
+
+ def test_init(self):
+ x = misc.policy_handle(text1, 1)
+ self.assertEquals(1, x.handle_type)
+ self.assertEquals(text1, str(x.uuid))
+
+ def test_repr(self):
+ x = misc.policy_handle(text1, 42)
+ self.assertEquals("policy_handle(%d, '%s')" % (42, text1), repr(x))
+
+ def test_str(self):
+ x = misc.policy_handle(text1, 42)
+ self.assertEquals("%d, %s" % (42, text1), str(x))
+