本文整理匯總了Python中ldapcherry.LdapCherry.searchuser方法的典型用法代碼示例。如果您正苦於以下問題:Python LdapCherry.searchuser方法的具體用法?Python LdapCherry.searchuser怎麽用?Python LdapCherry.searchuser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ldapcherry.LdapCherry
的用法示例。
在下文中一共展示了LdapCherry.searchuser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testHtml
# 需要導入模塊: from ldapcherry import LdapCherry [as 別名]
# 或者: from ldapcherry.LdapCherry import searchuser [as 別名]
def testHtml(self):
app = LdapCherry()
loadconf('./tests/cfg/ldapcherry_test.ini', app)
pages = {
'signin': app.signin(),
'index': app.index(),
'searchuser': app.searchuser('smit'),
'searchadmin':app.searchadmin('smit'),
'adduser': app.adduser(),
'modify':app.modify('jsmith'),
'selfmodify':app.selfmodify(),
}
for page in pages:
print(page)
htmlvalidator(pages[page])
示例2: testNaughtyStrings
# 需要導入模塊: from ldapcherry import LdapCherry [as 別名]
# 或者: from ldapcherry.LdapCherry import searchuser [as 別名]
def testNaughtyStrings(self):
app = LdapCherry()
loadconf('./tests/cfg/ldapcherry_test.ini', app)
with open('./tests/cfg/blns.json') as data_file:
data = json.load(data_file)
for attr in data:
print('testing: ' + attr)
# delete whatever is happening...
try:
app._deleteuser('test')
except:
pass
form = {'groups': {}, 'attrs': {'password1': u'password☭', 'password2': u'password☭', 'cn': 'Test', 'name': attr, 'uidNumber': u'1000', 'gidNumber': u'1000', 'home': u'/home/test', 'first-name': u'Test ☭', 'email': u'[email protected]', 'uid': 'test'}, 'roles': {'admin-lv3': u'on', 'admin-lv2': u'on', 'users': u'on'}}
app._adduser(form)
page = app.searchuser('test'),
app._deleteuser('test')
htmlvalidator(page[0])