selftest: Add a test for creds.{get,set}_secure_channel_type()
[nivanova/samba-autobuild/.git] / python / samba / tests / credentials.py
index 177553069747bac81d18a1f2b3ab53d16ba9ab67..bddbc46b94eec00d95256a1aef9f57f8dcbe6662 100644 (file)
@@ -26,6 +26,7 @@ import samba.tests
 import os
 import binascii
 from samba.compat import PY3
+from samba.dcerpc import misc
 
 class CredentialsTests(samba.tests.TestCaseInTempDir):
 
@@ -115,6 +116,13 @@ class CredentialsTests(samba.tests.TestCaseInTempDir):
         self.creds.set_workstation("myworksta")
         self.assertEqual("myworksta", self.creds.get_workstation())
 
+    def test_secure_channel_type(self):
+        self.assertEqual(misc.SEC_CHAN_NULL,
+                         self.creds.get_secure_channel_type())
+        self.creds.set_secure_channel_type(misc.SEC_CHAN_BDC)
+        self.assertEqual(misc.SEC_CHAN_BDC,
+                         self.creds.get_secure_channel_type())
+
     def test_get_nt_hash(self):
         password="geheim"
         hex_nthash="c2ae1fe6e648846352453e816f2aeb93"