本文整理匯總了Python中staxing.helper.Teacher.delete_assignment方法的典型用法代碼示例。如果您正苦於以下問題:Python Teacher.delete_assignment方法的具體用法?Python Teacher.delete_assignment怎麽用?Python Teacher.delete_assignment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類staxing.helper.Teacher
的用法示例。
在下文中一共展示了Teacher.delete_assignment方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestStaxingTutorTeacher
# 需要導入模塊: from staxing.helper import Teacher [as 別名]
# 或者: from staxing.helper.Teacher import delete_assignment [as 別名]
#.........這裏部分代碼省略.........
reading_options = self.teacher.get_book_sections()
reading_start = randint(0, (len(reading_options) - 1))
reading_end = reading_start + randint(1, 5)
reading_list = reading_options[reading_start:reading_end]
self.teacher.add_assignment(
assignment='reading',
args={
'title': assignment_title,
'description': 'Staxing test reading - cancel',
'periods': {
'First': (start_date_1, end_date_1),
},
'reading_list': reading_list,
'status': 'cancel',
'break_point': None,
}
)
assert('courses' in self.teacher.current_url()), \
'Not at dashboard'
self.teacher.rotate_calendar(end_date_1)
time.sleep(5.0)
with pytest.raises(NoSuchElementException):
self.teacher.find(
By.XPATH,
'//label[text()="%s"]' % assignment_title
)
@pytest.mark.skipif(str(306) not in TESTS, reason='Excluded')
def test_change_assignment(self):
"""No test placeholder."""
pass
@pytest.mark.skipif(str(307) not in TESTS, reason='Excluded')
def test_delete_assignment(self):
"""No test placeholder."""
assignment_title = 'Reading-%s' % Assignment.rword(5)
start_date = self.teacher.date_string(day_delta=1)
end_date = self.teacher.date_string(day_delta=3)
self.teacher.add_assignment(
assignment='reading',
args={
'title': assignment_title,
'periods': {
'all': (start_date, end_date),
},
'reading_list': ['1', '1.1'],
'status': 'draft',
'break_point': None,
}
)
assert('courses' in self.teacher.current_url()), \
'Not at dashboard'
self.teacher.rotate_calendar(end_date)
reading = self.teacher.find(
By.XPATH,
'//label[text()="%s"]' % assignment_title
)
time.sleep(5.0)
assert(reading), \
'%s not publishing on %s' % (assignment_title, end_date)
new_date = start_date.split('/')
new_date = '%s/%s' % (int(new_date[0]), int(new_date[1]))
self.teacher.wait.until(
expect.presence_of_element_located(
(By.XPATH,
'//label[@data-title="%s" and @data-opens-at="%s"]' %