Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
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
edx-analytics-data-api
Commits
e7785df7
Commit
e7785df7
authored
Dec 03, 2015
by
Dennis Jen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #89 from edx/dsjen/upgrade-pylint
Upgraded pylint to 1.5.0.
parents
5b5c792d
4856d4e0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
31 deletions
+12
-31
analytics_data_api/utils.py
+1
-1
analytics_data_api/v0/tests/views/test_courses.py
+2
-4
analytics_data_api/v0/tests/views/test_problems.py
+5
-4
analyticsdataserver/views.py
+3
-3
pylintrc
+0
-18
requirements/test.txt
+1
-1
No files found.
analytics_data_api/utils.py
View file @
e7785df7
...
...
@@ -74,7 +74,7 @@ def consolidate_answers(problem):
for
answer
in
answers
:
if
consolidated_answer
:
if
type
(
consolidated_answer
)
==
ProblemResponseAnswerDistribution
:
if
isinstance
(
consolidated_answer
,
ProblemResponseAnswerDistribution
)
:
consolidated_answer
.
count
+=
answer
.
count
else
:
consolidated_answer
.
first_response_count
+=
answer
.
first_response_count
...
...
analytics_data_api/v0/tests/views/test_courses.py
View file @
e7785df7
...
...
@@ -369,8 +369,7 @@ class CourseEnrollmentByGenderViewTests(CourseEnrollmentViewTestCaseMixin, Defau
for
gender
in
_genders
:
expected
[
gender
]
=
0
expected
=
[
expected
]
self
.
assertViewReturnsExpectedData
(
expected
)
self
.
assertViewReturnsExpectedData
([
expected
])
class
CourseEnrollmentViewTests
(
CourseEnrollmentViewTestCaseMixin
,
TestCaseWithAuthentication
):
...
...
@@ -465,8 +464,7 @@ class CourseEnrollmentModeViewTests(CourseEnrollmentViewTestCaseMixin, DefaultFi
expected
[
u'count'
]
=
1
expected
[
u'cumulative_count'
]
=
100
expected
=
[
expected
]
self
.
assertViewReturnsExpectedData
(
expected
)
self
.
assertViewReturnsExpectedData
([
expected
])
class
CourseEnrollmentByLocationViewTests
(
CourseEnrollmentViewTestCaseMixin
,
TestCaseWithAuthentication
):
...
...
analytics_data_api/v0/tests/views/test_problems.py
View file @
e7785df7
...
...
@@ -5,9 +5,10 @@
# pylint: disable=no-member,no-value-for-parameter
from
django_dynamic_fixture
import
G
import
json
from
django_dynamic_fixture
import
G
from
analytics_data_api.v0
import
models
from
analytics_data_api.v0.serializers
import
ProblemFirstLastResponseAnswerDistributionSerializer
,
\
GradeDistributionSerializer
,
SequentialOpenDistributionSerializer
...
...
@@ -124,10 +125,10 @@ class AnswerDistributionTests(TestCaseWithAuthentication):
expected_data
[
1
][
'consolidated_variant'
]
=
False
response
.
data
=
set
([
json
.
dumps
(
answer
)
for
answer
in
response
.
data
])
expected_data
=
set
([
json
.
dumps
(
answer
)
for
answer
in
expected_data
])
response
.
data
=
[
json
.
dumps
(
answer
)
for
answer
in
response
.
data
]
expected_data
=
[
json
.
dumps
(
answer
)
for
answer
in
expected_data
]
self
.
assertEquals
(
response
.
data
,
expected_data
)
self
.
assertEquals
(
set
(
response
.
data
),
set
(
expected_data
)
)
def
test_get_404
(
self
):
response
=
self
.
authenticated_get
(
'/api/v0/problems/
%
s
%
s'
%
(
"DOES-NOT-EXIST"
,
self
.
path
))
...
...
analyticsdataserver/views.py
View file @
e7785df7
from
django.conf
import
settings
from
django.db
import
connections
from
django.http
import
HttpResponse
from
rest_framework.renderers
import
JSONRenderer
from
rest_framework
import
permissions
from
rest_framework.renderers
import
JSONRenderer
from
rest_framework.response
import
Response
from
django.conf
import
settings
from
django.db
import
connections
from
rest_framework.views
import
APIView
...
...
pylintrc
View file @
e7785df7
...
...
@@ -7,9 +7,6 @@
# pygtk.require().
#init-hook=''
# Profiled execution.
profile=no
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS, migrations, settings
...
...
@@ -91,10 +88,6 @@ reports=no
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Add a comment according to your evaluation note. This is used by the global
# evaluation report (RP0004).
comment=no
[TYPECHECK]
...
...
@@ -106,10 +99,6 @@ ignore-mixin-members=yes
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
...
...
@@ -131,9 +120,6 @@ generated-members=
[BASIC]
# Required attributes for module, separated by a comma
required-attributes=
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
...
...
@@ -275,10 +261,6 @@ max-public-methods=20
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
...
...
requirements/test.txt
View file @
e7785df7
...
...
@@ -10,5 +10,5 @@ nose-ignore-docstring==0.2
nose==1.3.4
pep257==0.4.1
pep8==1.6.0
pylint==1.
4.1
pylint==1.
5.0
pytz==2014.10
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