Merge pull request #4860 from edx/benp/lint-cleanup
pep8 improvements on bok-choy tests.
This commit is contained in:
@@ -16,7 +16,6 @@ class CourseAboutPage(CoursePage):
|
||||
def is_browser_on_page(self):
|
||||
return self.q(css='section.course-info').present
|
||||
|
||||
|
||||
def register(self):
|
||||
"""
|
||||
Navigate to the registration page.
|
||||
|
||||
@@ -204,6 +204,7 @@ class DiscussionSortPreferencePage(CoursePage):
|
||||
"""
|
||||
self.browser.refresh()
|
||||
|
||||
|
||||
class DiscussionTabSingleThreadPage(CoursePage):
|
||||
def __init__(self, browser, course_id, thread_id):
|
||||
super(DiscussionTabSingleThreadPage, self).__init__(browser, course_id)
|
||||
@@ -258,6 +259,7 @@ class InlineDiscussionPage(PageObject):
|
||||
def element_exists(self, selector):
|
||||
return self.q(css=self._discussion_selector + " " + selector).present
|
||||
|
||||
|
||||
class InlineDiscussionThreadPage(DiscussionThreadPage):
|
||||
def __init__(self, browser, thread_id):
|
||||
super(InlineDiscussionThreadPage, self).__init__(
|
||||
@@ -387,4 +389,3 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
|
||||
lambda: _match_messages(text).results == [],
|
||||
"waiting for dismissed alerts to disappear"
|
||||
).fulfill()
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ class PeerConfirmPage(PageObject):
|
||||
If `is_calibrating` is false, try to continue to peer grading.
|
||||
Otherwise, try to continue to calibration grading.
|
||||
"""
|
||||
self.q(css='input.calibration-interstitial-page-button'
|
||||
if is_calibrating else 'input.interstitial-page-button'
|
||||
).first.click()
|
||||
if is_calibrating:
|
||||
css_selector = 'input.calibration-interstitial-page-button'
|
||||
else:
|
||||
css_selector = 'input.interstitial-page-button'
|
||||
self.q(css=css_selector).first.click()
|
||||
|
||||
@@ -84,7 +84,6 @@ class TabNavPage(PageObject):
|
||||
else:
|
||||
return current_tab_list[0].strip().split('\n')[0] == tab_name
|
||||
|
||||
|
||||
def _is_on_tab_promise(self, tab_name):
|
||||
"""
|
||||
Return a `Promise` that the user is on the tab `tab_name`.
|
||||
|
||||
@@ -6,6 +6,7 @@ from bok_choy.page_object import PageObject
|
||||
from bok_choy.promise import Promise
|
||||
from .utils import wait_for_xblock_initialization
|
||||
|
||||
|
||||
class AcidView(PageObject):
|
||||
"""
|
||||
A :class:`.PageObject` representing the rendered view of the :class:`.AcidBlock`.
|
||||
|
||||
@@ -3,6 +3,7 @@ Utility methods useful for XBlock page tests.
|
||||
"""
|
||||
from bok_choy.promise import Promise
|
||||
|
||||
|
||||
def wait_for_xblock_initialization(page, xblock_css):
|
||||
"""
|
||||
Wait for the xblock with the given CSS to finish initializing.
|
||||
|
||||
@@ -3,7 +3,6 @@ from ..fixtures.course import CourseFixture
|
||||
from .helpers import UniqueCourseTest
|
||||
|
||||
|
||||
|
||||
class StudioCourseTest(UniqueCourseTest):
|
||||
"""
|
||||
Base class for all Studio course tests.
|
||||
|
||||
@@ -383,8 +383,8 @@ class DiscussionUserProfileTest(UniqueCourseTest):
|
||||
CourseFixture(**self.course_info).install()
|
||||
# The following line creates a user enrolled in our course, whose
|
||||
# threads will be viewed, but not the one who will view the page.
|
||||
# It isn't necessary to log them in, but using the AutoAuthPage
|
||||
# saves a lot of code.
|
||||
# It isn't necessary to log them in, but using the AutoAuthPage
|
||||
# saves a lot of code.
|
||||
self.profiled_user_id = AutoAuthPage(
|
||||
self.browser,
|
||||
username=self.PROFILED_USERNAME,
|
||||
@@ -414,7 +414,7 @@ class DiscussionUserProfileTest(UniqueCourseTest):
|
||||
all_pages = range(1, total_pages + 1)
|
||||
|
||||
def _check_page():
|
||||
# ensure the page being displayed as "current" is the expected one
|
||||
# ensure the page being displayed as "current" is the expected one
|
||||
self.assertEqual(page.get_current_page(), current_page)
|
||||
# ensure the expected threads are being shown in the right order
|
||||
threads_expected = threads[(current_page - 1) * self.PAGE_SIZE:current_page * self.PAGE_SIZE]
|
||||
|
||||
@@ -270,7 +270,6 @@ class VideoTest(UniqueCourseTest):
|
||||
XBlockFixtureDesc('video', 'Video')
|
||||
)))).install()
|
||||
|
||||
|
||||
# Auto-auth register for the course
|
||||
AutoAuthPage(self.browser, course_id=self.course_id).visit()
|
||||
|
||||
@@ -333,7 +332,6 @@ class XBlockAcidBase(UniqueCourseTest):
|
||||
self.course_info_page = CourseInfoPage(self.browser, self.course_id)
|
||||
self.tab_nav = TabNavPage(self.browser)
|
||||
|
||||
|
||||
def validate_acid_block_view(self, acid_block):
|
||||
"""
|
||||
Verify that the LMS view for the Acid Block is correct
|
||||
@@ -345,7 +343,6 @@ class XBlockAcidBase(UniqueCourseTest):
|
||||
self.assertTrue(acid_block.scope_passed('preferences'))
|
||||
self.assertTrue(acid_block.scope_passed('user_info'))
|
||||
|
||||
|
||||
def test_acid_block(self):
|
||||
"""
|
||||
Verify that all expected acid block tests pass in the lms.
|
||||
|
||||
@@ -624,7 +624,7 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
|
||||
Then I see the group configuration is saved successfully
|
||||
"""
|
||||
def try_to_save_and_verify_error_message(message):
|
||||
# Try to save
|
||||
# Try to save
|
||||
config.save()
|
||||
# Verify that configuration is still in editing mode
|
||||
self.assertEqual(config.mode, 'edit')
|
||||
|
||||
@@ -794,7 +794,7 @@ class Html5VideoTest(VideoBaseTest):
|
||||
|
||||
self.assertIn(unicode_text, self.video.captions_text)
|
||||
|
||||
#Then I can download transcript in "srt" format that has text "好 各位同学"
|
||||
# Then I can download transcript in "srt" format that has text "好 各位同学"
|
||||
unicode_text = "好 各位同学".decode('utf-8')
|
||||
self.assertTrue(self.video.downloaded_transcript_contains_text('srt', unicode_text))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user