本文整理汇总了Python中helperKolabWAP.KolabWAPTestHelpers.log方法的典型用法代码示例。如果您正苦于以下问题:Python KolabWAPTestHelpers.log方法的具体用法?Python KolabWAPTestHelpers.log怎么用?Python KolabWAPTestHelpers.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helperKolabWAP.KolabWAPTestHelpers
的用法示例。
在下文中一共展示了KolabWAPTestHelpers.log方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: KolabAutoCreateFolders
# 需要导入模块: from helperKolabWAP import KolabWAPTestHelpers [as 别名]
# 或者: from helperKolabWAP.KolabWAPTestHelpers import log [as 别名]
class KolabAutoCreateFolders(unittest.TestCase):
def setUp(self):
self.kolabWAPhelper = KolabWAPTestHelpers()
self.driver = self.kolabWAPhelper.init_driver()
def helper_modify_autocreate_folders(self):
# read kolab.conf
fo = open("/etc/kolab/kolab.conf", "r+")
content = fo.read()
fo.close()
newContactsFolderName = "Contacts" + datetime.datetime.now().strftime("%H%M%S")
# find [kolab], find line starting with 'Contacts, replace with 'Contacts125559': {
pos = content.index("[kolab]")
pos = content.index("'Contacts", pos)
posAfter = content.index(": {", pos)
content = content[:pos] + "'" + newContactsFolderName + "'" + content[posAfter:]
# write kolab.conf
fo = open("/etc/kolab/kolab.conf", "wb")
fo.write(content)
fo.close()
self.kolabWAPhelper.log("kolab.conf has been changed, autocreate_folders now contains " + newContactsFolderName)
return newContactsFolderName
def test_modified_foldername_in_new_domain(self):
kolabWAPhelper = self.kolabWAPhelper
kolabWAPhelper.log ("Running test: test_modified_foldername_in_new_domain")
# login
kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")
domainname = kolabWAPhelper.create_domain()
#modify the default folders in /etc/kolab/kolab.conf
newContactsFolderName = self.helper_modify_autocreate_folders()
username, emailLogin, password = kolabWAPhelper.create_user()
kolabWAPhelper.logout_kolab_wap()
# check if mailbox has been created, with the modified folder name
p = subprocess.Popen("kolab lm | grep " + username + " | grep " + newContactsFolderName, shell=True, stdout=subprocess.PIPE)
out, err = p.communicate()
if newContactsFolderName not in out:
self.assertTrue(False, "kolab lm cannot find mailbox with folder " + newContactsFolderName + " for new user " + username)
def tearDown(self):
# write current page for debugging purposes
self.kolabWAPhelper.log_current_page()
self.driver.close()
示例2: KolabWAPCreateUserAndEditSelf
# 需要导入模块: from helperKolabWAP import KolabWAPTestHelpers [as 别名]
# 或者: from helperKolabWAP.KolabWAPTestHelpers import log [as 别名]
class KolabWAPCreateUserAndEditSelf(unittest.TestCase):
def setUp(self):
self.kolabWAPhelper = KolabWAPTestHelpers()
self.driver = self.kolabWAPhelper.init_driver()
# edit yourself; testing bug https://issues.kolab.org/show_bug.cgi?id=2414
def helper_user_edits_himself(self):
driver = self.driver
elem = driver.find_element_by_xpath("//div[@class=\"settings\"]")
elem.click()
self.kolabWAPhelper.wait_loading(1.0)
elem = driver.find_element_by_name("initials")
elem.send_keys("T")
elem = driver.find_element_by_xpath("//input[@value=\"Submit\"]")
elem.click()
self.kolabWAPhelper.wait_loading()
elem = driver.find_element_by_xpath("//div[@id=\"message\"]")
self.assertEquals("User updated successfully.", elem.text, "User was not saved successfully, message: " + elem.text)
self.kolabWAPhelper.log("User has updated his own data successfully")
def test_edit_user_himself(self):
kolabWAPhelper = self.kolabWAPhelper
kolabWAPhelper.log("Running test: test_edit_user_himself")
# login Directory Manager
kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")
username, emailLogin, password = kolabWAPhelper.create_user()
kolabWAPhelper.logout_kolab_wap()
# login the new user
kolabWAPhelper.login_kolab_wap("/kolab-webadmin", emailLogin, password)
self.helper_user_edits_himself()
kolabWAPhelper.logout_kolab_wap()
def test_edit_user_himself_multi_domain_with_quota(self):
kolabWAPhelper = self.kolabWAPhelper
kolabWAPhelper.log("Running test: test_edit_user_himself_multi_domain_with_quota")
# login Directory Manager
kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")
domainname = kolabWAPhelper.create_domain()
username, emailLogin, password = kolabWAPhelper.create_user(mail_quota="20kb")
kolabWAPhelper.logout_kolab_wap()
# login the new user
kolabWAPhelper.login_kolab_wap("/kolab-webadmin", emailLogin, password)
self.helper_user_edits_himself()
kolabWAPhelper.logout_kolab_wap()
def test_edit_user_himself_multi_domain(self):
kolabWAPhelper = self.kolabWAPhelper
kolabWAPhelper.log("Running test: test_edit_user_himself_multi_domain")
# login Directory Manager
kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")
domainname = kolabWAPhelper.create_domain()
username, emailLogin, password = kolabWAPhelper.create_user()
kolabWAPhelper.logout_kolab_wap()
# login the new user
kolabWAPhelper.login_kolab_wap("/kolab-webadmin", emailLogin, password)
self.helper_user_edits_himself()
kolabWAPhelper.logout_kolab_wap()
def tearDown(self):
# write current page for debugging purposes
self.kolabWAPhelper.log_current_page()
self.driver.quit()