Commit c5a7911b by Jay Zoldak

Fix pylint disable pragmas that were pep8 violations

parent 021e6f5b
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_false, assert_equal, assert_regexp_matches # pylint: disable=E0611 from nose.tools import assert_false, assert_equal, assert_regexp_matches # pylint: disable=E0611
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_true, assert_equal # pylint: disable=E0611 from nose.tools import assert_true, assert_equal # pylint: disable=E0611
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
# Lettuce formats proposed definitions for unimplemented steps with the # Lettuce formats proposed definitions for unimplemented steps with the
# argument name "step" instead of "_step" and pylint does not like that. # argument name "step" instead of "_step" and pylint does not like that.
#pylint: disable=W0613 # pylint: disable=W0613
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_true, assert_in # pylint: disable=E0611 from nose.tools import assert_true, assert_in # pylint: disable=E0611
......
# disable missing docstring # disable missing docstring
#pylint: disable=C0111 # pylint: disable=C0111
from lettuce import world from lettuce import world
from nose.tools import assert_equal, assert_in # pylint: disable=E0611 from nose.tools import assert_equal, assert_in # pylint: disable=E0611
......
# disable missing docstring # disable missing docstring
#pylint: disable=C0111 # pylint: disable=C0111
from lettuce import world, step from lettuce import world, step
from component_settings_editor_helpers import enter_xml_in_advanced_problem from component_settings_editor_helpers import enter_xml_in_advanced_problem
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from terrain.steps import reload_the_page from terrain.steps import reload_the_page
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_in # pylint: disable=E0611 from nose.tools import assert_in # pylint: disable=E0611
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.keys import Keys
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from common import * from common import *
......
# disable missing docstring # disable missing docstring
#pylint: disable=C0111 # pylint: disable=C0111
from lettuce import world, step from lettuce import world, step
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from common import * from common import *
......
# disable missing docstring # disable missing docstring
#pylint: disable=C0111 # pylint: disable=C0111
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_in # pylint: disable=no-name-in-module from nose.tools import assert_in # pylint: disable=no-name-in-module
......
# disable missing docstring # disable missing docstring
#pylint: disable=C0111 # pylint: disable=C0111
import json import json
from lettuce import world, step from lettuce import world, step
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_equal # pylint: disable=E0611 from nose.tools import assert_equal # pylint: disable=E0611
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from common import * from common import *
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from django.conf import settings from django.conf import settings
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from lettuce.django import django_url from lettuce.django import django_url
......
#pylint: disable=C0111 # pylint: disable=C0111
from lettuce import world, step from lettuce import world, step
from xmodule.modulestore import Location from xmodule.modulestore import Location
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#pylint: disable=E1101 # pylint: disable=E1101
import json import json
import mock import mock
......
#pylint: disable=E1101 # pylint: disable=E1101
""" """
Tests for import_from_xml using the mongo modulestore. Tests for import_from_xml using the mongo modulestore.
""" """
......
#pylint: disable=E1103, E1101 # pylint: disable=E1103, E1101
import copy import copy
import logging import logging
......
#pylint: disable=C0111,W0613 # pylint: disable=C0111,W0613
from django.http import (HttpResponse, HttpResponseServerError, from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound) HttpResponseNotFound)
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
Unit tests for the asset upload endpoint. Unit tests for the asset upload endpoint.
""" """
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
#pylint: disable=W0212 # pylint: disable=W0212
from datetime import datetime from datetime import datetime
from io import BytesIO from io import BytesIO
......
...@@ -13,7 +13,7 @@ from path import path ...@@ -13,7 +13,7 @@ from path import path
# This is a convenience for ensuring (a) that we can consistently find the files # This is a convenience for ensuring (a) that we can consistently find the files
# and (b) that the files are the same in Jenkins as in local dev. # and (b) that the files are the same in Jenkins as in local dev.
os.environ['SERVICE_VARIANT'] = 'bok_choy' os.environ['SERVICE_VARIANT'] = 'bok_choy'
os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() #pylint: disable=E1120 os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() # pylint: disable=E1120
from .aws import * # pylint: disable=W0401, W0614 from .aws import * # pylint: disable=W0401, W0614
...@@ -23,13 +23,13 @@ from .aws import * # pylint: disable=W0401, W0614 ...@@ -23,13 +23,13 @@ from .aws import * # pylint: disable=W0401, W0614
INSTALLED_APPS += ('django_extensions',) INSTALLED_APPS += ('django_extensions',)
# Redirect to the test_root folder within the repo # Redirect to the test_root folder within the repo
TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" #pylint: disable=E1120 TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" # pylint: disable=E1120
GITHUB_REPO_ROOT = (TEST_ROOT / "data").abspath() GITHUB_REPO_ROOT = (TEST_ROOT / "data").abspath()
LOG_DIR = (TEST_ROOT / "log").abspath() LOG_DIR = (TEST_ROOT / "log").abspath()
# Configure Mongo modulestore to use the test folder within the repo # Configure Mongo modulestore to use the test folder within the repo
for store in ["default", "direct"]: for store in ["default", "direct"]:
MODULESTORE[store]['OPTIONS']['fs_root'] = (TEST_ROOT / "data").abspath() #pylint: disable=E1120 MODULESTORE[store]['OPTIONS']['fs_root'] = (TEST_ROOT / "data").abspath() # pylint: disable=E1120
# Enable django-pipeline and staticfiles # Enable django-pipeline and staticfiles
STATIC_ROOT = (TEST_ROOT / "staticfiles").abspath() STATIC_ROOT = (TEST_ROOT / "staticfiles").abspath()
......
#pylint: disable=W0614, W0401 # pylint: disable=W0614, W0401
from .dev import * from .dev import *
FILE_UPLOAD_HANDLERS = ( FILE_UPLOAD_HANDLERS = (
......
...@@ -137,6 +137,6 @@ if settings.DEBUG: ...@@ -137,6 +137,6 @@ if settings.DEBUG:
pass pass
# Custom error pages # Custom error pages
#pylint: disable=C0103 # pylint: disable=C0103
handler404 = 'contentstore.views.render_404' handler404 = 'contentstore.views.render_404'
handler500 = 'contentstore.views.render_500' handler500 = 'contentstore.views.render_500'
...@@ -89,7 +89,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): ...@@ -89,7 +89,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
""" """
self.client.logout() self.client.logout()
resp = self.client.get(self.url_unlocked) resp = self.client.get(self.url_unlocked)
self.assertEqual(resp.status_code, 200) #pylint: disable=E1103 self.assertEqual(resp.status_code, 200) # pylint: disable=E1103
def test_locked_asset_not_logged_in(self): def test_locked_asset_not_logged_in(self):
""" """
...@@ -98,7 +98,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): ...@@ -98,7 +98,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
""" """
self.client.logout() self.client.logout()
resp = self.client.get(self.url_locked) resp = self.client.get(self.url_locked)
self.assertEqual(resp.status_code, 403) #pylint: disable=E1103 self.assertEqual(resp.status_code, 403) # pylint: disable=E1103
def test_locked_asset_not_registered(self): def test_locked_asset_not_registered(self):
""" """
...@@ -107,30 +107,30 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): ...@@ -107,30 +107,30 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
""" """
self.client.login(username=self.usr, password=self.pwd) self.client.login(username=self.usr, password=self.pwd)
resp = self.client.get(self.url_locked) resp = self.client.get(self.url_locked)
self.assertEqual(resp.status_code, 403) #pylint: disable=E1103 self.assertEqual(resp.status_code, 403) # pylint: disable=E1103
def test_locked_asset_registered(self): def test_locked_asset_registered(self):
""" """
Test that locked assets behave appropriately in case user is logged in Test that locked assets behave appropriately in case user is logged in
and registered for the course. and registered for the course.
""" """
#pylint: disable=E1101 # pylint: disable=E1101
course_id = "/".join([self.loc_locked.org, self.loc_locked.course, '2012_Fall']) course_id = "/".join([self.loc_locked.org, self.loc_locked.course, '2012_Fall'])
CourseEnrollment.enroll(self.user, course_id) CourseEnrollment.enroll(self.user, course_id)
self.assertTrue(CourseEnrollment.is_enrolled(self.user, course_id)) self.assertTrue(CourseEnrollment.is_enrolled(self.user, course_id))
self.client.login(username=self.usr, password=self.pwd) self.client.login(username=self.usr, password=self.pwd)
resp = self.client.get(self.url_locked) resp = self.client.get(self.url_locked)
self.assertEqual(resp.status_code, 200) #pylint: disable=E1103 self.assertEqual(resp.status_code, 200) # pylint: disable=E1103
def test_locked_asset_staff(self): def test_locked_asset_staff(self):
""" """
Test that locked assets behave appropriately in case user is staff. Test that locked assets behave appropriately in case user is staff.
""" """
#pylint: disable=E1101 # pylint: disable=E1101
course_id = "/".join([self.loc_locked.org, self.loc_locked.course, '2012_Fall']) course_id = "/".join([self.loc_locked.org, self.loc_locked.course, '2012_Fall'])
self.client.login(username=self.staff_usr, password=self.staff_pwd) self.client.login(username=self.staff_usr, password=self.staff_pwd)
resp = self.client.get(self.url_locked) resp = self.client.get(self.url_locked)
self.assertEqual(resp.status_code, 200) #pylint: disable=E1103 self.assertEqual(resp.status_code, 200) # pylint: disable=E1103
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
Browser set up for acceptance tests. Browser set up for acceptance tests.
""" """
#pylint: disable=E1101 # pylint: disable=E1101
#pylint: disable=W0613 # pylint: disable=W0613
from lettuce import before, after, world from lettuce import before, after, world
from splinter.browser import Browser from splinter.browser import Browser
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
# Disable the "wildcard import" warning so we can bring in all methods from # Disable the "wildcard import" warning so we can bring in all methods from
# course helpers and ui helpers # course helpers and ui helpers
#pylint: disable=W0401 # pylint: disable=W0401
# Disable the "Unused import %s from wildcard import" warning # Disable the "Unused import %s from wildcard import" warning
#pylint: disable=W0614 # pylint: disable=W0614
# Disable the "unused argument" warning because lettuce uses "step" # Disable the "unused argument" warning because lettuce uses "step"
#pylint: disable=W0613 # pylint: disable=W0613
# django_url is assigned late in the process of loading lettuce, # django_url is assigned late in the process of loading lettuce,
# so we import this as a module, and then read django_url from # so we import this as a module, and then read django_url from
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world from lettuce import world
......
...@@ -9,7 +9,7 @@ from os.path import abspath, realpath, dirname, join as joinpath ...@@ -9,7 +9,7 @@ from os.path import abspath, realpath, dirname, join as joinpath
from django.core.exceptions import SuspiciousOperation from django.core.exceptions import SuspiciousOperation
import logging import logging
log = logging.getLogger(__name__) #pylint: disable=C0103 log = logging.getLogger(__name__) # pylint: disable=C0103
def resolved(rpath): def resolved(rpath):
""" """
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
""" """
Tests of the Capa XModule Tests of the Capa XModule
""" """
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=R0904 # pylint: disable=R0904
#pylint: disable=C0103 # pylint: disable=C0103
#pylint: disable=C0302 # pylint: disable=C0302
import datetime import datetime
import json import json
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#pylint: disable=W0212 # pylint: disable=W0212
"""Test for Video Xmodule functional logic. """Test for Video Xmodule functional logic.
These test data read from xml, not from mongo. These test data read from xml, not from mongo.
......
# disable missing docstring # disable missing docstring
#pylint: disable=C0111 # pylint: disable=C0111
import unittest import unittest
......
...@@ -10,7 +10,7 @@ def load_data_str(rel_path): ...@@ -10,7 +10,7 @@ def load_data_str(rel_path):
Load a file from the "data" directory as a string. Load a file from the "data" directory as a string.
`rel_path` is the path relative to the data directory. `rel_path` is the path relative to the data directory.
""" """
full_path = path(__file__).abspath().dirname() / "data" / rel_path #pylint: disable=E1120 full_path = path(__file__).abspath().dirname() / "data" / rel_path # pylint: disable=E1120
with open(full_path) as data_file: with open(full_path) as data_file:
return data_file.read() return data_file.read()
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#pylint: disable=C0103 # pylint: disable=C0103
#pylint: disable=W0622 # pylint: disable=W0622
#pylint: disable=W0212 # pylint: disable=W0212
#pylint: disable=W0613 # pylint: disable=W0613
import sys, os import sys, os
from path import path from path import path
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from lettuce.django import django_url from lettuce.django import django_url
...@@ -186,7 +186,7 @@ def confirm_details_match(step): ...@@ -186,7 +186,7 @@ def confirm_details_match(step):
@step(u'I am at the payment page') @step(u'I am at the payment page')
def at_the_payment_page(step): def at_the_payment_page(step):
world.wait_for_present('input[name=transactionSignature]') world.wait_for_present('input[name=transactionSignature]')
@step(u'I submit valid payment information$') @step(u'I submit valid payment information$')
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from lettuce.django import django_url from lettuce.django import django_url
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
......
#pylint: disable=C0111 # pylint: disable=C0111
from lettuce import step from lettuce import step
from lettuce import world from lettuce import world
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_in, assert_equals # pylint: disable=E0611 from nose.tools import assert_in, assert_equals # pylint: disable=E0611
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import step, world from lettuce import step, world
from django.contrib.auth.models import User from django.contrib.auth.models import User
......
#pylint: disable=C0111 # pylint: disable=C0111
import datetime import datetime
import os import os
import pytz import pytz
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from common import course_id, course_location from common import course_id, course_location
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from lettuce.django import django_url from lettuce.django import django_url
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
#EVERY PROBLEM TYPE MUST HAVE THE FOLLOWING: #EVERY PROBLEM TYPE MUST HAVE THE FOLLOWING:
# -Section in Dictionary containing: # -Section in Dictionary containing:
......
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#pylint: disable=C0111 # pylint: disable=C0111
from lettuce import world, step from lettuce import world, step
import os import os
......
#pylint: disable=C0111 # pylint: disable=C0111
from time import sleep from time import sleep
......
...@@ -111,7 +111,7 @@ class CoursewareContextTestCase(ModuleStoreTestCase): ...@@ -111,7 +111,7 @@ class CoursewareContextTestCase(ModuleStoreTestCase):
] ]
utils.add_courseware_context(threads, self.course) utils.add_courseware_context(threads, self.course)
def assertThreadCorrect(thread, discussion, expected_title): #pylint: disable=C0103 def assertThreadCorrect(thread, discussion, expected_title): # pylint: disable=C0103
self.assertEqual( self.assertEqual(
set(thread.keys()), set(thread.keys()),
set(["commentable_id", "courseware_url", "courseware_title"]) set(["commentable_id", "courseware_url", "courseware_title"])
...@@ -146,7 +146,7 @@ class CategoryMapTestCase(ModuleStoreTestCase): ...@@ -146,7 +146,7 @@ class CategoryMapTestCase(ModuleStoreTestCase):
self.course.discussion_topics = {} self.course.discussion_topics = {}
self.course.save() self.course.save()
self.discussion_num = 0 self.discussion_num = 0
self.maxDiff = None #pylint: disable=C0103 self.maxDiff = None # pylint: disable=C0103
def create_discussion(self, discussion_category, discussion_target, **kwargs): def create_discussion(self, discussion_category, discussion_target, **kwargs):
self.discussion_num += 1 self.discussion_num += 1
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
Define steps for bulk email acceptance test. Define steps for bulk email acceptance test.
""" """
#pylint: disable=C0111 # pylint: disable=C0111
#pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from lettuce.django import mail from lettuce.django import mail
......
...@@ -38,7 +38,7 @@ class TestHandleDashboardError(unittest.TestCase): ...@@ -38,7 +38,7 @@ class TestHandleDashboardError(unittest.TestCase):
Test handle_dashboard_error decorator. Test handle_dashboard_error decorator.
""" """
def test_error(self): def test_error(self):
#pylint: disable=W0613 # pylint: disable=W0613
@tools.handle_dashboard_error @tools.handle_dashboard_error
def view(request, course_id): def view(request, course_id):
""" """
...@@ -50,7 +50,7 @@ class TestHandleDashboardError(unittest.TestCase): ...@@ -50,7 +50,7 @@ class TestHandleDashboardError(unittest.TestCase):
self.assertEqual(response, {'error': 'Oh noes!'}) self.assertEqual(response, {'error': 'Oh noes!'})
def test_no_error(self): def test_no_error(self):
#pylint: disable=W0613 # pylint: disable=W0613
@tools.handle_dashboard_error @tools.handle_dashboard_error
def view(request, course_id): def view(request, course_id):
""" """
......
...@@ -5,7 +5,7 @@ Settings for bok choy tests ...@@ -5,7 +5,7 @@ Settings for bok choy tests
import os import os
from path import path from path import path
CONFIG_ROOT = path(__file__).abspath().dirname() #pylint: disable=E1120 CONFIG_ROOT = path(__file__).abspath().dirname() # pylint: disable=E1120
TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root"
########################## Prod-like settings ################################### ########################## Prod-like settings ###################################
......
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