pylint fixes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Unit tests for instructor.api methods.
|
||||
"""
|
||||
# pylint: disable=E1111
|
||||
import unittest
|
||||
import json
|
||||
from urllib import quote
|
||||
@@ -28,24 +29,27 @@ from instructor_task.api_helper import AlreadyRunningError
|
||||
|
||||
|
||||
@common_exceptions_400
|
||||
def view_success(request):
|
||||
def view_success(request): # pylint: disable=W0613
|
||||
"A dummy view for testing that returns a simple HTTP response"
|
||||
return HttpResponse('success')
|
||||
|
||||
|
||||
@common_exceptions_400
|
||||
def view_user_doesnotexist(request):
|
||||
def view_user_doesnotexist(request): # pylint: disable=W0613
|
||||
"A dummy view that raises a User.DoesNotExist exception"
|
||||
raise User.DoesNotExist()
|
||||
|
||||
|
||||
@common_exceptions_400
|
||||
def view_alreadyrunningerror(request):
|
||||
def view_alreadyrunningerror(request): # pylint: disable=W0613
|
||||
"A dummy view that raises an AlreadyRunningError exception"
|
||||
raise AlreadyRunningError()
|
||||
|
||||
|
||||
class TestCommonExceptions400(unittest.TestCase):
|
||||
"""
|
||||
Testing the common_exceptions_400 decorator.
|
||||
"""
|
||||
def setUp(self):
|
||||
self.request = Mock(spec=HttpRequest)
|
||||
self.request.META = {}
|
||||
@@ -749,12 +753,6 @@ class TestInstructorAPITaskLists(ModuleStoreTestCase, LoginEnrollmentTestCase):
|
||||
self.assertEqual(json.loads(response.content), expected_res)
|
||||
|
||||
|
||||
|
||||
# class TestInstructorAPILevelsForums
|
||||
# # list_forum_members
|
||||
# # update_forum_role_membership
|
||||
|
||||
|
||||
class TestInstructorAPIHelpers(TestCase):
|
||||
""" Test helpers for instructor.api """
|
||||
def test_split_input_list(self):
|
||||
|
||||
@@ -189,7 +189,7 @@ def students_update_enrollment(request, course_id):
|
||||
})
|
||||
# catch and log any exceptions
|
||||
# so that one error doesn't cause a 500.
|
||||
except Exception as exc:
|
||||
except Exception as exc: # pylint: disable=W0703
|
||||
log.exception("Error while #{}ing student")
|
||||
log.exception(exc)
|
||||
results.append({
|
||||
@@ -401,10 +401,10 @@ def get_distribution(request, course_id):
|
||||
if not feature is None:
|
||||
p_dist = analytics.distributions.profile_distribution(course_id, feature)
|
||||
response_payload['feature_results'] = {
|
||||
'feature': p_dist.feature,
|
||||
'feature_display_name': p_dist.feature_display_name,
|
||||
'data': p_dist.data,
|
||||
'type': p_dist.type,
|
||||
'feature': p_dist.feature,
|
||||
'feature_display_name': p_dist.feature_display_name,
|
||||
'data': p_dist.data,
|
||||
'type': p_dist.type,
|
||||
}
|
||||
|
||||
if p_dist.type == 'EASY_CHOICE':
|
||||
|
||||
Reference in New Issue
Block a user