本文整理汇总了Python中Utils.Config类的典型用法代码示例。如果您正苦于以下问题:Python Config类的具体用法?Python Config怎么用?Python Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
def test(self):
self.verificationErrors = []
Config.find_element(Config.openSettings).click()
time.sleep(1)
user = Config.find_element(Config.settings_email).text
InitCase.init_case(menu="ALL", view="date")
sender = Config.get_sender()
receiver = Config.get_receiver()
sections = ["Tomorrow", "Upcoming", "Someday"]
for i in range(3):
sec = random.choice(sections)
ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.task), Config.find_element(Config.list_sectionByName, sec)).perform()
sections.remove(sec)
Config.sync()
if user == receiver: user = sender
else: user = receiver
ChangeUser.change_user(user)
InitCase.init_case(menu="ALL", view="date")
try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, sec))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例2: test
def test(self):
InitCase.init_case(menu="MAIN")
self.verificationErrors = []
listID = NewList.listID
list = Config.find_element(Config.main_listByID, listID)
allTasks = Config.find_element(Config.main_AllTasks)
#~Drag and Drop~
ActionChains(Config.get_driver()).click_and_hold(list).perform()
time.sleep(0.5)
ActionChains(Config.get_driver()).move_to_element_with_offset(allTasks, 238, 0).perform()
time.sleep(0.5)
ActionChains(Config.get_driver()).release().perform()
time.sleep(1)
style = list.get_attribute("style")
left = style.find("left: ") + 6
position = ""
for i in range(3):
position = position + style[left]
left = left + 1
try: self.assertEqual("238", position)
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例3: saveDeck
def saveDeck(self, player):
"""
Sauvegarde du deck dans le fichier de configuration
Le deck sauvegardé est associé à un nom
Si le nom est déjà présent dans le fichier de configuration le deck est écrasé
"""
if len(player.cardsList) < Player.totalCardIntoDeck:
print("Le nombre de carte dans le deck du joueur n'est pas suffisant")
return False
cardList = [ card.idCard for card in player.cardsList ]
deckName = input("Choisissez le nom de votre deck : ")
decks = self.config["Decks"]
deck = [ deck for deck in decks if deck["Name"] == deckName ]
if len(deck) <= 0:
decks.append({"Name":deckName, "CardList" : cardList})
else:
deck[0]["CardList"] = cardList
Config.saveConfig(self.config)
return True
示例4: select_day
def select_day(self, today):
Config.find_element(Config.cal_selectedDay).get_attribute("data-full")
today = today.split("-")
today = datetime.date(int(today[0]), int(today[1]) + 1, int(today[2]))
x = datetime.timedelta(2)
xDate = today + x
return str(xDate.year) + "-" + str(xDate.month - 1) + "-" + str(xDate.day)
示例5: other_user
def other_user(self):
u1 = Config.get_receiver()
u2 = Config.get_sender()
if self.user == u1:
return u2
else:
return u1
示例6: test
def test(self):
taskID = InitCase.init_case(menu="ALL", view="priority")
self.verificationErrors = []
ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.taskByID, taskID), Config.find_element(Config.list_sectionByName, "Normal")).perform()
try: self.assertFalse(Config.is_element_present(Config.taskPriority))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例7: save
def save(self):
threads = self.general.ui.horizontalSlider.sliderPosition()
chunksize = self.general.ui.lineEdit.text()
downspeed = self.network.ui.lineEdit_2.text()
upspeed = self.network.ui.lineEdit_3.text()
#Saving each property to file :)
Config.changeProperty('THREADS', threads)
Config.changeProperty('CHUNK_SIZE', chunksize)
Config.changeProperty('DOWNLOAD_MAX',downspeed)
Config.changeProperty('UPLOAD_MAX', upspeed)
Config.saveContacts(self.general.ui.plainTextEdit.toPlainText())
self.hide()
示例8: test
def test(self):
InitCase.init_case(menu="ALL", taskOption="subtasks")
self.verificationErrors = []
Config.find_element(Config.subtasks_title).click()
Config.find_element(Config.subtasks_title).clear()
Config.find_element(Config.subtasks_title).send_keys("edited")
Config.find_element(Config.task_badgeByIconName, "subtasks").click()
try: self.assertEqual("edited", Config.find_element(Config.subtasks_title).text)
except AssertionError as e: self.verificationErrors.append(str(e))
示例9: test
def test(self):
InitCase.init_case(menu="ALL", taskOption="subtasks")
self.verificationErrors = []
Config.find_element(Config.subtasks_title).click()
time.sleep(1)
#Check badge
try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "subtasks").get_attribute("data-badge"))
except AssertionError as e: self.verificationErrors.append(str(e))
#Check task status
try: self.assertEqual("unchecked", Config.find_element(Config.subtask).get_attribute("data-status"))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例10: test
def test(self):
taskID = InitCase.init_case(menu="ALL", view="priority", taskOption="open")
self.verificationErrors = []
Config.wait_for_element(Config.task_PrioritySelector)
Config.find_element(Config.task_PrioritySelector).click()
time.sleep(2)
Config.find_element(Config.task_closeButton).click()
Config.wait_for_element(Config.task_closeButton, present=False)
try: self.assertEqual(Config.find_element(Config.taskBySectionName, "High").get_attribute("data-task-id"),taskID)
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例11: test
def test(self):
InitCase.init_case(taskOption="note")
self.verificationErrors = []
noteText = "edit edit edit edit"
Config.find_element(Config.note).clear()
Config.find_element(Config.note).send_keys(noteText)
try: self.assertEqual(" ", Config.find_element(Config.task_badgeByIconName, "note").get_attribute("data-badge"))
except AssertionError as e: self.verificationErrors.append(str(e))
Config.find_element(Config.task_closeButton).click()
Config.wait_for_element(Config.task_closeButton, present=False)
InitCase.task_options("note")
time.sleep(1)
try: self.assertEqual(noteText, Config.find_element(Config.note).text)
except AssertionError as e: self.verificationErrors.append(str(e))
示例12: test
def test(self):
InitCase.init_case(menu="ALL", taskOption="open")
self.verificationErrors = []
Config.wait_for_element(Config.task_PrioritySelector)
Config.find_element(Config.task_PrioritySelector).click()
time.sleep(2)
Config.find_element(Config.task_closeButton).click()
Config.wait_for_element(Config.task_closeButton, present=False)
try: self.assertTrue(Config.is_element_present(Config.taskPriority))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例13: test
def test(self):
InitCase.init_case(menu="ALL", taskNo=0)
self.verificationErrors = []
try: self.assertFalse(Config.is_element_present(Config.task))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例14: test
def test(self):
InitCase.init_case(menu="ALL", view="priority", taskNo=0)
self.verificationErrors = []
CreateTaskF.create_a_task("priHigh", "High")
try: self.assertTrue(Config.is_element_present(Config.taskPriority))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例15: test
def test(self):
InitCase.init_case(menu="MAIN")
self.verificationErrors = []
listID = NewList.listID
ActionChains(Config.get_driver()).move_to_element(Config.find_element(Config.main_listByID, listID)).perform()
time.sleep(1)
Config.find_element(Config.main_listOptionsID, listID).click()
Config.find_element(Config.main_listDeleteID, listID).click()
time.sleep(1)
Config.find_element(Config.listDeleteConfirm).click()
try: self.assertFalse(Config.is_element_present(Config.main_listByID, listID))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)