Commit 4bf140a7 by Clinton Blackburn

Instructed Pylint to ignore the responses library

ECOM-3895
parent e8d2e22a
...@@ -28,7 +28,7 @@ class CourseTests(ElasticsearchTestMixin, TestCase): ...@@ -28,7 +28,7 @@ class CourseTests(ElasticsearchTestMixin, TestCase):
for attr, value in attrs.items(): for attr, value in attrs.items():
self.assertEqual(getattr(course, attr), value) self.assertEqual(getattr(course, attr), value)
@responses.activate # pylint: disable=no-member @responses.activate
def mock_refresh_all(self): def mock_refresh_all(self):
""" """
Mock the external APIs and refresh all course data. Mock the external APIs and refresh all course data.
...@@ -108,7 +108,6 @@ class CourseTests(ElasticsearchTestMixin, TestCase): ...@@ -108,7 +108,6 @@ class CourseTests(ElasticsearchTestMixin, TestCase):
return request_callback return request_callback
# pylint: disable=no-member
url = '{host}/courses/'.format(host=ECOMMERCE_API_URL) url = '{host}/courses/'.format(host=ECOMMERCE_API_URL)
responses.add_callback(responses.GET, url, callback=ecommerce_api_callback(url, course_bodies), responses.add_callback(responses.GET, url, callback=ecommerce_api_callback(url, course_bodies),
content_type=JSON) content_type=JSON)
...@@ -238,7 +237,7 @@ class CourseTests(ElasticsearchTestMixin, TestCase): ...@@ -238,7 +237,7 @@ class CourseTests(ElasticsearchTestMixin, TestCase):
} }
self.assertEqual(Course.search(query), expected) self.assertEqual(Course.search(query), expected)
@responses.activate # pylint: disable=no-member @responses.activate
def test_refresh(self): def test_refresh(self):
""" Verify the method refreshes data for a single course. """ """ Verify the method refreshes data for a single course. """
course_id = 'SesameStreetX/Cookies/1T2016' course_id = 'SesameStreetX/Cookies/1T2016'
...@@ -250,7 +249,7 @@ class CourseTests(ElasticsearchTestMixin, TestCase): ...@@ -250,7 +249,7 @@ class CourseTests(ElasticsearchTestMixin, TestCase):
# Mock the call to the E-Commerce API # Mock the call to the E-Commerce API
url = '{host}/courses/{course_id}/'.format(host=ECOMMERCE_API_URL, course_id=course_id) url = '{host}/courses/{course_id}/'.format(host=ECOMMERCE_API_URL, course_id=course_id)
responses.add(responses.GET, url, body=json.dumps(body), content_type=JSON) # pylint: disable=no-member responses.add(responses.GET, url, body=json.dumps(body), content_type=JSON)
# Refresh the course, and ensure the attributes are correct. # Refresh the course, and ensure the attributes are correct.
course = Course.refresh(course_id, ACCESS_TOKEN) course = Course.refresh(course_id, ACCESS_TOKEN)
......
...@@ -2,17 +2,48 @@ ...@@ -2,17 +2,48 @@
# ** DO NOT EDIT THIS FILE ** # ** DO NOT EDIT THIS FILE **
# *************************** # ***************************
# #
# It is generated by: # This file was generated by edx-lint: http://github.com/edx.edx-lint
# $ edx_lint write pylintrc
# #
# If you want to change this file, you have two choices, depending on whether
# you want to make a local change that applies only to this repo, or whether
# you want to make a central change that applies to all repos using edx-lint.
# #
# LOCAL CHANGE:
# #
# 1. Edit the local pylintrc_tweaks file to add changes just to this
# repo's file.
# #
# 2. Run:
# #
# $ edx_lint write pylintrc
# #
# 3. This will modify the local file. Submit a pull request to get it
# checked in so that others will benefit.
# #
# #
# STAY AWAY! # CENTRAL CHANGE:
#
# 1. Edit the pylintrc file in the edx-lint repo at
# https://github.com/edx/edx-lint/blob/master/edx_lint/files/pylintrc
#
# 2. Make a new version of edx_lint, which involves the usual steps of
# incrementing the version number, submitting and reviewing a pull
# request, and updating the edx-lint version reference in this repo.
#
# 3. Install the newer version of edx-lint.
#
# 4. Run:
#
# $ edx_lint write pylintrc
#
# 5. This will modify the local file. Submit a pull request to get it
# checked in so that others will benefit.
#
#
#
#
#
# STAY AWAY FROM THIS FILE!
# #
# #
# #
...@@ -24,7 +55,7 @@ ...@@ -24,7 +55,7 @@
[MASTER] [MASTER]
ignore = ,migrations, settings, wsgi.py ignore = ,migrations, settings, wsgi.py
persistent = yes persistent = yes
load-plugins = edx_lint.pylint,pylint_django load-plugins = edx_lint.pylint,pylint_django,pylint_celery
[MESSAGES CONTROL] [MESSAGES CONTROL]
disable = disable =
...@@ -37,6 +68,7 @@ disable = ...@@ -37,6 +68,7 @@ disable =
abstract-class-little-used, abstract-class-little-used,
no-init, no-init,
fixme, fixme,
logging-format-interpolation,
too-many-lines, too-many-lines,
no-self-use, no-self-use,
too-many-ancestors, too-many-ancestors,
...@@ -61,7 +93,7 @@ bad-functions = map,filter,apply,input ...@@ -61,7 +93,7 @@ bad-functions = map,filter,apply,input
module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$ const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$
class-rgx = [A-Z_][a-zA-Z0-9]+$ class-rgx = [A-Z_][a-zA-Z0-9]+$
function-rgx = ([a-z_][a-z0-9_]{2,30}|test_[a-z0-9_]+)$ function-rgx = ([a-z_][a-z0-9_]{2,40}|test_[a-z0-9_]+)$
method-rgx = ([a-z_][a-z0-9_]{2,40}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$ method-rgx = ([a-z_][a-z0-9_]{2,40}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$
attr-rgx = [a-z_][a-z0-9_]{2,30}$ attr-rgx = [a-z_][a-z0-9_]{2,30}$
argument-rgx = [a-z_][a-z0-9_]{2,30}$ argument-rgx = [a-z_][a-z0-9_]{2,30}$
...@@ -92,7 +124,7 @@ ignore-imports = no ...@@ -92,7 +124,7 @@ ignore-imports = no
[TYPECHECK] [TYPECHECK]
ignore-mixin-members = yes ignore-mixin-members = yes
ignored-classes = SQLObject,WSGIRequest,UserFactory,CatalogFactory ignored-classes = SQLObject,WSGIRequest,UserFactory,CatalogFactory,responses
unsafe-load-any-extension = yes unsafe-load-any-extension = yes
generated-members = generated-members =
REQUEST, REQUEST,
...@@ -148,4 +180,4 @@ int-import-graph = ...@@ -148,4 +180,4 @@ int-import-graph =
[EXCEPTIONS] [EXCEPTIONS]
overgeneral-exceptions = Exception overgeneral-exceptions = Exception
# d9dbd5cb8a05067710b776137902855c9ca7f6a6 # aa393e07e100b773853da38867c6a050ff9d6bfb
...@@ -8,4 +8,4 @@ const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$ ...@@ -8,4 +8,4 @@ const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$
DISABLE+= ,invalid-name,missing-docstring DISABLE+= ,invalid-name,missing-docstring
[TYPECHECK] [TYPECHECK]
ignored-classes+= ,WSGIRequest,UserFactory,CatalogFactory ignored-classes+= ,WSGIRequest,UserFactory,CatalogFactory,responses
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