Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
4bf140a7
Commit
4bf140a7
authored
Mar 15, 2016
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instructed Pylint to ignore the responses library
ECOM-3895
parent
e8d2e22a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
12 deletions
+43
-12
course_discovery/apps/courses/tests/test_models.py
+3
-4
pylintrc
+39
-7
pylintrc_tweaks
+1
-1
No files found.
course_discovery/apps/courses/tests/test_models.py
View file @
4bf140a7
...
@@ -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
)
...
...
pylintrc
View file @
4bf140a7
...
@@ -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,
3
0}|test_[a-z0-9_]+)$
function-rgx = ([a-z_][a-z0-9_]{2,
4
0}|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
pylintrc_tweaks
View file @
4bf140a7
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment