Commit ea967148 by Ben Patterson

Merge pull request #4860 from edx/benp/lint-cleanup

pep8 improvements on bok-choy tests.
parents 14de1a3f 4343a953
...@@ -16,7 +16,6 @@ class CourseAboutPage(CoursePage): ...@@ -16,7 +16,6 @@ class CourseAboutPage(CoursePage):
def is_browser_on_page(self): def is_browser_on_page(self):
return self.q(css='section.course-info').present return self.q(css='section.course-info').present
def register(self): def register(self):
""" """
Navigate to the registration page. Navigate to the registration page.
......
...@@ -204,6 +204,7 @@ class DiscussionSortPreferencePage(CoursePage): ...@@ -204,6 +204,7 @@ class DiscussionSortPreferencePage(CoursePage):
""" """
self.browser.refresh() self.browser.refresh()
class DiscussionTabSingleThreadPage(CoursePage): class DiscussionTabSingleThreadPage(CoursePage):
def __init__(self, browser, course_id, thread_id): def __init__(self, browser, course_id, thread_id):
super(DiscussionTabSingleThreadPage, self).__init__(browser, course_id) super(DiscussionTabSingleThreadPage, self).__init__(browser, course_id)
...@@ -258,6 +259,7 @@ class InlineDiscussionPage(PageObject): ...@@ -258,6 +259,7 @@ class InlineDiscussionPage(PageObject):
def element_exists(self, selector): def element_exists(self, selector):
return self.q(css=self._discussion_selector + " " + selector).present return self.q(css=self._discussion_selector + " " + selector).present
class InlineDiscussionThreadPage(DiscussionThreadPage): class InlineDiscussionThreadPage(DiscussionThreadPage):
def __init__(self, browser, thread_id): def __init__(self, browser, thread_id):
super(InlineDiscussionThreadPage, self).__init__( super(InlineDiscussionThreadPage, self).__init__(
...@@ -387,4 +389,3 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin): ...@@ -387,4 +389,3 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
lambda: _match_messages(text).results == [], lambda: _match_messages(text).results == [],
"waiting for dismissed alerts to disappear" "waiting for dismissed alerts to disappear"
).fulfill() ).fulfill()
...@@ -27,6 +27,8 @@ class PeerConfirmPage(PageObject): ...@@ -27,6 +27,8 @@ class PeerConfirmPage(PageObject):
If `is_calibrating` is false, try to continue to peer grading. If `is_calibrating` is false, try to continue to peer grading.
Otherwise, try to continue to calibration grading. Otherwise, try to continue to calibration grading.
""" """
self.q(css='input.calibration-interstitial-page-button' if is_calibrating:
if is_calibrating else 'input.interstitial-page-button' css_selector = 'input.calibration-interstitial-page-button'
).first.click() else:
css_selector = 'input.interstitial-page-button'
self.q(css=css_selector).first.click()
...@@ -84,7 +84,6 @@ class TabNavPage(PageObject): ...@@ -84,7 +84,6 @@ class TabNavPage(PageObject):
else: else:
return current_tab_list[0].strip().split('\n')[0] == tab_name return current_tab_list[0].strip().split('\n')[0] == tab_name
def _is_on_tab_promise(self, tab_name): def _is_on_tab_promise(self, tab_name):
""" """
Return a `Promise` that the user is on the tab `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 ...@@ -6,6 +6,7 @@ from bok_choy.page_object import PageObject
from bok_choy.promise import Promise from bok_choy.promise import Promise
from .utils import wait_for_xblock_initialization from .utils import wait_for_xblock_initialization
class AcidView(PageObject): class AcidView(PageObject):
""" """
A :class:`.PageObject` representing the rendered view of the :class:`.AcidBlock`. A :class:`.PageObject` representing the rendered view of the :class:`.AcidBlock`.
......
...@@ -3,6 +3,7 @@ Utility methods useful for XBlock page tests. ...@@ -3,6 +3,7 @@ Utility methods useful for XBlock page tests.
""" """
from bok_choy.promise import Promise from bok_choy.promise import Promise
def wait_for_xblock_initialization(page, xblock_css): def wait_for_xblock_initialization(page, xblock_css):
""" """
Wait for the xblock with the given CSS to finish initializing. Wait for the xblock with the given CSS to finish initializing.
......
...@@ -3,7 +3,6 @@ from ..fixtures.course import CourseFixture ...@@ -3,7 +3,6 @@ from ..fixtures.course import CourseFixture
from .helpers import UniqueCourseTest from .helpers import UniqueCourseTest
class StudioCourseTest(UniqueCourseTest): class StudioCourseTest(UniqueCourseTest):
""" """
Base class for all Studio course tests. Base class for all Studio course tests.
......
...@@ -270,7 +270,6 @@ class VideoTest(UniqueCourseTest): ...@@ -270,7 +270,6 @@ class VideoTest(UniqueCourseTest):
XBlockFixtureDesc('video', 'Video') XBlockFixtureDesc('video', 'Video')
)))).install() )))).install()
# Auto-auth register for the course # Auto-auth register for the course
AutoAuthPage(self.browser, course_id=self.course_id).visit() AutoAuthPage(self.browser, course_id=self.course_id).visit()
...@@ -333,7 +332,6 @@ class XBlockAcidBase(UniqueCourseTest): ...@@ -333,7 +332,6 @@ class XBlockAcidBase(UniqueCourseTest):
self.course_info_page = CourseInfoPage(self.browser, self.course_id) self.course_info_page = CourseInfoPage(self.browser, self.course_id)
self.tab_nav = TabNavPage(self.browser) self.tab_nav = TabNavPage(self.browser)
def validate_acid_block_view(self, acid_block): def validate_acid_block_view(self, acid_block):
""" """
Verify that the LMS view for the Acid Block is correct Verify that the LMS view for the Acid Block is correct
...@@ -345,7 +343,6 @@ class XBlockAcidBase(UniqueCourseTest): ...@@ -345,7 +343,6 @@ class XBlockAcidBase(UniqueCourseTest):
self.assertTrue(acid_block.scope_passed('preferences')) self.assertTrue(acid_block.scope_passed('preferences'))
self.assertTrue(acid_block.scope_passed('user_info')) self.assertTrue(acid_block.scope_passed('user_info'))
def test_acid_block(self): def test_acid_block(self):
""" """
Verify that all expected acid block tests pass in the lms. Verify that all expected acid block tests pass in the lms.
......
...@@ -794,7 +794,7 @@ class Html5VideoTest(VideoBaseTest): ...@@ -794,7 +794,7 @@ class Html5VideoTest(VideoBaseTest):
self.assertIn(unicode_text, self.video.captions_text) 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') unicode_text = "好 各位同学".decode('utf-8')
self.assertTrue(self.video.downloaded_transcript_contains_text('srt', unicode_text)) self.assertTrue(self.video.downloaded_transcript_contains_text('srt', unicode_text))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment