本文整理汇总了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])