Пример #1
0
def f (ident, filter, queue):
  with credentials.credentials (("*****@*****.**", "password", ident)):
    for item in ad.AD (server=ident).search (filter):
      queue.put ((ident, item))
    queue.put ((ident, None))
Пример #2
0
 def test_from_path (self):
   with credentials.credentials (config.cred):
     ou2 = adbase.ADBase.from_path (self.ou0.ADsPath)
     self.assertEquals (self.ou, ou2)
Пример #3
0
 def test_credentials_invalid_tuple (self):
   with self.assertRaises (credentials.InvalidCredentialsError):
     credentials.credentials ((1, 2, 3, 4))
Пример #4
0
 def test_credentials_object (self):
   cred = credentials.Credentials ("username", "password")
   self.assertIs (cred, credentials.credentials (cred))
Пример #5
0
 def test_none (self):
   self.assertIs (None, credentials.credentials (None))
Пример #6
0
 def setUp (self):
   with credentials.credentials (config.cred):
     self.root = core.root_obj (server=config.server)
   self._ou = self.root.GetObject ("organizationalUnit", config.test_base)
   self.ou = build_from_data (self._ou, DATA)
   self.addCleanup (self._remove_ou)