當前位置: 首頁>>代碼示例>>Python>>正文


Python Creds._config_name方法代碼示例

本文整理匯總了Python中activedirectory.core.creds.Creds._config_name方法的典型用法代碼示例。如果您正苦於以下問題:Python Creds._config_name方法的具體用法?Python Creds._config_name怎麽用?Python Creds._config_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在activedirectory.core.creds.Creds的用法示例。


在下文中一共展示了Creds._config_name方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_acquire_multi

# 需要導入模塊: from activedirectory.core.creds import Creds [as 別名]
# 或者: from activedirectory.core.creds.Creds import _config_name [as 別名]
 def test_acquire_multi(self, conf):
     conf.require(ad_user=True)
     domain = conf.domain()
     principal = conf.ad_user_account()
     password = conf.ad_user_password()
     creds1 = ADCreds(domain)
     creds1.acquire(principal, password)
     ccache1 = creds1._ccache_name()
     config1 = creds1._config_name()
     assert ccache1 == os.environ['KRB5CCNAME']
     assert config1 == os.environ['KRB5_CONFIG']
     creds2 = ADCreds(domain)
     creds2.acquire(principal, password)
     ccache2 = creds2._ccache_name()
     config2 = creds2._config_name()
     assert ccache2 == os.environ['KRB5CCNAME']
     assert config2 == os.environ['KRB5_CONFIG']
     assert ccache1 != ccache2
     assert config1 != config2
     activate(creds1)
     assert os.environ['KRB5CCNAME'] == ccache1
     assert os.environ['KRB5_CONFIG'] == config1
     activate(creds2)
     assert os.environ['KRB5CCNAME'] == ccache2
     assert os.environ['KRB5_CONFIG'] == config2
開發者ID:theatlantic,項目名稱:python-active-directory,代碼行數:27,代碼來源:test_creds.py

示例2: test_release_multi

# 需要導入模塊: from activedirectory.core.creds import Creds [as 別名]
# 或者: from activedirectory.core.creds.Creds import _config_name [as 別名]
 def test_release_multi(self, conf):
     conf.require(ad_user=True)
     domain = conf.domain()
     principal = conf.ad_user_account()
     password = conf.ad_user_password()
     ccorig = os.environ.get('KRB5CCNAME')
     cforig = os.environ.get('KRB5_CONFIG')
     creds1 = ADCreds(domain)
     creds1.acquire(principal, password)
     ccache1 = creds1._ccache_name()
     config1 = creds1._config_name()
     creds2 = ADCreds(domain)
     creds2.acquire(principal, password)
     ccache2 = creds2._ccache_name()
     config2 = creds2._config_name()
     creds1.release()
     assert os.environ['KRB5CCNAME'] == ccache2
     assert os.environ['KRB5_CONFIG'] == config2
     creds2.release()
     assert os.environ.get('KRB5CCNAME') == ccorig
     assert os.environ.get('KRB5_CONFIG') == cforig
開發者ID:theatlantic,項目名稱:python-active-directory,代碼行數:23,代碼來源:test_creds.py

示例3: test_cleanup_files

# 需要導入模塊: from activedirectory.core.creds import Creds [as 別名]
# 或者: from activedirectory.core.creds.Creds import _config_name [as 別名]
 def test_cleanup_files(self, conf):
     conf.require(ad_user=True)
     domain = conf.domain()
     principal = conf.ad_user_account()
     password = conf.ad_user_password()
     creds = ADCreds(domain)
     creds.acquire(principal, password)
     ccache = creds._ccache_name()
     config = creds._config_name()
     assert os.access(ccache, os.R_OK)
     assert os.access(config, os.R_OK)
     creds.release()
     assert not os.access(ccache, os.R_OK)
     assert not os.access(config, os.R_OK)
開發者ID:theatlantic,項目名稱:python-active-directory,代碼行數:16,代碼來源:test_creds.py

示例4: test_cleanup_environment

# 需要導入模塊: from activedirectory.core.creds import Creds [as 別名]
# 或者: from activedirectory.core.creds.Creds import _config_name [as 別名]
 def test_cleanup_environment(self, conf):
     conf.require(ad_user=True)
     domain = conf.domain()
     principal = conf.ad_user_account()
     password = conf.ad_user_password()
     ccorig = os.environ.get('KRB5CCNAME')
     cforig = os.environ.get('KRB5_CONFIG')
     creds = ADCreds(domain)
     creds.acquire(principal, password)
     ccache = creds._ccache_name()
     config = creds._config_name()
     assert ccache != ccorig
     assert config != cforig
     creds.release()
     assert os.environ.get('KRB5CCNAME') == ccorig
     assert os.environ.get('KRB5_CONFIG') == cforig
開發者ID:theatlantic,項目名稱:python-active-directory,代碼行數:18,代碼來源:test_creds.py


注:本文中的activedirectory.core.creds.Creds._config_name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。