Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
a11f2877
Commit
a11f2877
authored
Feb 27, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6998 from stvstnfrd/quality/pep8
Extend PEP8 coverage
parents
99e85556
41318981
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
220 additions
and
132 deletions
+220
-132
cms/urls.py
+2
-1
common/djangoapps/heartbeat/urls.py
+3
-1
common/djangoapps/pipeline_js/urls.py
+3
-1
docs/en_us/enrollment_api/source/conf.py
+0
-4
docs/en_us/platform_api/source/conf.py
+35
-11
lms/djangoapps/class_dashboard/urls.py
+3
-1
lms/djangoapps/django_comment_client/base/urls.py
+3
-1
lms/djangoapps/django_comment_client/forum/urls.py
+3
-1
lms/djangoapps/django_comment_client/urls.py
+3
-1
lms/djangoapps/instructor/views/api_urls.py
+3
-1
lms/djangoapps/shoppingcart/urls.py
+3
-1
lms/djangoapps/survey/urls.py
+3
-1
lms/urls.py
+3
-1
openedx/core/djangoapps/course_groups/tests/test_cohorts.py
+0
-1
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
+1
-5
openedx/core/djangoapps/user_api/accounts/views.py
+1
-2
openedx/core/djangoapps/user_api/tests/test_views.py
+0
-1
openedx/core/operations.py
+1
-0
pavelib/bok_choy.py
+2
-1
pavelib/paver_tests/test_paver_bok_choy_cmds.py
+14
-9
pavelib/paver_tests/test_paver_quality.py
+5
-3
pavelib/quality.py
+124
-79
pavelib/tests.py
+0
-1
pavelib/utils/test/suites/nose_suite.py
+1
-1
pavelib/utils/test/utils.py
+1
-0
scripts/release.py
+3
-3
No files found.
cms/urls.py
View file @
a11f2877
...
...
@@ -12,7 +12,8 @@ COURSELIKE_KEY_PATTERN = r'(?P<course_key_string>({}|{}))'.format(
# Pattern to match a library key only
LIBRARY_KEY_PATTERN
=
r'(?P<library_key_string>library-v1:[^/+]+\+[^/+]+)'
urlpatterns
=
patterns
(
''
,
# nopep8
urlpatterns
=
patterns
(
''
,
url
(
r'^transcripts/upload$'
,
'contentstore.views.upload_transcripts'
,
name
=
'upload_transcripts'
),
url
(
r'^transcripts/download$'
,
'contentstore.views.download_transcripts'
,
name
=
'download_transcripts'
),
...
...
common/djangoapps/heartbeat/urls.py
View file @
a11f2877
from
django.conf.urls
import
url
,
patterns
urlpatterns
=
patterns
(
''
,
# nopep8
urlpatterns
=
patterns
(
''
,
url
(
r'^$'
,
'heartbeat.views.heartbeat'
,
name
=
'heartbeat'
),
)
common/djangoapps/pipeline_js/urls.py
View file @
a11f2877
...
...
@@ -3,7 +3,9 @@ URL patterns for Javascript files used to load all of the XModule JS in one wad.
"""
from
django.conf.urls
import
url
,
patterns
urlpatterns
=
patterns
(
'pipeline_js.views'
,
# nopep8
urlpatterns
=
patterns
(
'pipeline_js.views'
,
url
(
r'^files\.json$'
,
'xmodule_js_files'
,
name
=
'xmodule_js_files'
),
url
(
r'^xmodule\.js$'
,
'requirejs_xmodule'
,
name
=
'requirejs_xmodule'
),
)
docs/en_us/enrollment_api/source/conf.py
View file @
a11f2877
...
...
@@ -54,8 +54,6 @@ if on_rtd:
else
:
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
'lms'
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
...
...
@@ -72,5 +70,3 @@ exclude_patterns = ['build', 'links.rst']
project
=
u'edX Enrollment API Version 1'
copyright
=
u'2015, edX'
docs/en_us/platform_api/source/conf.py
View file @
a11f2877
...
...
@@ -8,15 +8,41 @@ import os
from
path
import
path
import
sys
import
mock
MOCK_MODULES
=
[
'lxml'
,
'requests'
,
'xblock'
,
'fields'
,
'xblock.fields'
,
'frament'
,
'xblock.fragment'
,
'webob'
,
'multidict'
,
'webob.multidict'
,
'core'
,
'xblock.core'
,
'runtime'
,
'xblock.runtime'
,
'sortedcontainers'
,
'contracts'
,
'plugin'
,
'xblock.plugin'
,
'opaque_keys.edx.asides'
,
'asides'
,
'dogstats_wrapper'
,
'fs'
,
'fs.errors'
,
'edxmako'
,
'edxmako.shortcuts'
,
'shortcuts'
,
'crum'
,
'opaque_keys.edx.locator'
,
'LibraryLocator'
,
'Location'
]
for
mod_name
in
MOCK_MODULES
:
MOCK_MODULES
=
[
'lxml'
,
'requests'
,
'xblock'
,
'fields'
,
'xblock.fields'
,
'frament'
,
'xblock.fragment'
,
'webob'
,
'multidict'
,
'webob.multidict'
,
'core'
,
'xblock.core'
,
'runtime'
,
'xblock.runtime'
,
'sortedcontainers'
,
'contracts'
,
'plugin'
,
'xblock.plugin'
,
'opaque_keys.edx.asides'
,
'asides'
,
'dogstats_wrapper'
,
'fs'
,
'fs.errors'
,
'edxmako'
,
'edxmako.shortcuts'
,
'shortcuts'
,
'crum'
,
'opaque_keys.edx.locator'
,
'LibraryLocator'
,
'Location'
,
]
for
mod_name
in
MOCK_MODULES
:
sys
.
modules
[
mod_name
]
=
mock
.
Mock
()
on_rtd
=
os
.
environ
.
get
(
'READTHEDOCS'
,
None
)
==
'True'
...
...
@@ -83,5 +109,3 @@ project = u'edX Platform API Version 0.5 Alpha'
copyright
=
u'2015, edX'
exclude_patterns
=
[
'build'
,
'links.rst'
]
lms/djangoapps/class_dashboard/urls.py
View file @
a11f2877
...
...
@@ -6,7 +6,9 @@ from django.conf.urls import patterns, url
from
django.conf
import
settings
COURSE_ID_PATTERN
=
settings
.
COURSE_ID_PATTERN
urlpatterns
=
patterns
(
''
,
# nopep8
urlpatterns
=
patterns
(
''
,
# Json request data for metrics for entire course
url
(
r'^{}/all_sequential_open_distrib$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'class_dashboard.views.all_sequential_open_distrib'
,
name
=
"all_sequential_open_distrib"
),
...
...
lms/djangoapps/django_comment_client/base/urls.py
View file @
a11f2877
from
django.conf.urls.defaults
import
url
,
patterns
urlpatterns
=
patterns
(
'django_comment_client.base.views'
,
# nopep8
urlpatterns
=
patterns
(
'django_comment_client.base.views'
,
url
(
r'upload$'
,
'upload'
,
name
=
'upload'
),
url
(
r'threads/(?P<thread_id>[\w\-]+)/update$'
,
'update_thread'
,
name
=
'update_thread'
),
url
(
r'threads/(?P<thread_id>[\w\-]+)/reply$'
,
'create_comment'
,
name
=
'create_comment'
),
...
...
lms/djangoapps/django_comment_client/forum/urls.py
View file @
a11f2877
from
django.conf.urls.defaults
import
url
,
patterns
urlpatterns
=
patterns
(
'django_comment_client.forum.views'
,
# nopep8
urlpatterns
=
patterns
(
'django_comment_client.forum.views'
,
url
(
r'users/(?P<user_id>\w+)/followed$'
,
'followed_threads'
,
name
=
'followed_threads'
),
url
(
r'users/(?P<user_id>\w+)$'
,
'user_profile'
,
name
=
'user_profile'
),
url
(
r'^(?P<discussion_id>[\w\-.]+)/threads/(?P<thread_id>\w+)$'
,
'single_thread'
,
name
=
'single_thread'
),
...
...
lms/djangoapps/django_comment_client/urls.py
View file @
a11f2877
from
django.conf.urls.defaults
import
url
,
patterns
,
include
urlpatterns
=
patterns
(
''
,
# nopep8
urlpatterns
=
patterns
(
''
,
url
(
r'forum/?'
,
include
(
'django_comment_client.forum.urls'
)),
url
(
r''
,
include
(
'django_comment_client.base.urls'
)),
)
lms/djangoapps/instructor/views/api_urls.py
View file @
a11f2877
...
...
@@ -5,7 +5,9 @@ Instructor API endpoint urls.
from
django.conf.urls
import
patterns
,
url
urlpatterns
=
patterns
(
''
,
# nopep8
urlpatterns
=
patterns
(
''
,
url
(
r'^students_update_enrollment$'
,
'instructor.views.api.students_update_enrollment'
,
name
=
"students_update_enrollment"
),
url
(
r'^register_and_enroll_students$'
,
...
...
lms/djangoapps/shoppingcart/urls.py
View file @
a11f2877
from
django.conf.urls
import
patterns
,
url
from
django.conf
import
settings
urlpatterns
=
patterns
(
'shoppingcart.views'
,
# nopep8
urlpatterns
=
patterns
(
'shoppingcart.views'
,
url
(
r'^postpay_callback/$'
,
'postpay_callback'
),
# Both the ~accept and ~reject callback pages are handled here
url
(
r'^receipt/(?P<ordernum>[0-9]*)/$'
,
'show_receipt'
),
url
(
r'^donation/$'
,
'donate'
,
name
=
'donation'
),
...
...
lms/djangoapps/survey/urls.py
View file @
a11f2877
...
...
@@ -5,7 +5,9 @@ URL mappings for the Survey feature
from
django.conf.urls
import
patterns
,
url
urlpatterns
=
patterns
(
'survey.views'
,
# nopep8
urlpatterns
=
patterns
(
'survey.views'
,
url
(
r'^(?P<survey_name>[0-9A-Za-z]+)/$'
,
'view_survey'
,
name
=
'view_survey'
),
url
(
r'^(?P<survey_name>[0-9A-Za-z]+)/answers/$'
,
'submit_answers'
,
name
=
'submit_answers'
),
)
lms/urls.py
View file @
a11f2877
...
...
@@ -12,7 +12,9 @@ if settings.DEBUG or settings.FEATURES.get('ENABLE_DJANGO_ADMIN_SITE'):
# Use urlpatterns formatted as within the Django docs with first parameter "stuck" to the open parenthesis
# pylint: disable=bad-continuation
urlpatterns
=
(
''
,
# nopep8
urlpatterns
=
(
''
,
# certificate view
url
(
r'^update_certificate$'
,
'certificates.views.update_certificate'
),
url
(
r'^request_certificate$'
,
'certificates.views.request_certificate'
),
...
...
openedx/core/djangoapps/course_groups/tests/test_cohorts.py
View file @
a11f2877
...
...
@@ -225,7 +225,6 @@ class TestCohorts(ModuleStoreTestCase):
# get_cohort should return a group for user
self
.
assertEquals
(
cohorts
.
get_cohort
(
user
,
course
.
id
)
.
name
,
"AutoGroup"
)
def
test_auto_cohorting
(
self
):
"""
Make sure cohorts.get_cohort() does the right thing with auto_cohort_groups
...
...
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
View file @
a11f2877
...
...
@@ -13,23 +13,19 @@ from student.models import UserProfile
TEST_PASSWORD
=
"test"
@ddt.ddt
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
class
TestAccountAPI
(
APITestCase
):
def
setUp
(
self
):
super
(
TestAccountAPI
,
self
)
.
setUp
()
self
.
anonymous_client
=
APIClient
()
self
.
different_user
=
UserFactory
.
create
(
password
=
TEST_PASSWORD
)
self
.
different_client
=
APIClient
()
self
.
staff_user
=
UserFactory
(
is_staff
=
True
,
password
=
TEST_PASSWORD
)
self
.
staff_client
=
APIClient
()
self
.
user
=
UserFactory
.
create
(
password
=
TEST_PASSWORD
)
self
.
url
=
reverse
(
"accounts_api"
,
kwargs
=
{
'username'
:
self
.
user
.
username
})
def
test_get_account_anonymous_user
(
self
):
...
...
openedx/core/djangoapps/user_api/accounts/views.py
View file @
a11f2877
...
...
@@ -157,4 +157,4 @@ class AccountView(APIView):
}
validation_errors
[
'field_errors'
]
=
field_errors
return
validation_errors
\ No newline at end of file
return
validation_errors
openedx/core/djangoapps/user_api/tests/test_views.py
View file @
a11f2877
...
...
@@ -1599,4 +1599,3 @@ class UpdateEmailOptInTestCase(ApiTestCase, ModuleStoreTestCase):
self
.
assertHttpBadRequest
(
response
)
with
self
.
assertRaises
(
UserOrgTag
.
DoesNotExist
):
UserOrgTag
.
objects
.
get
(
user
=
self
.
user
,
org
=
self
.
course
.
id
.
org
,
key
=
"email-optin"
)
openedx/core/operations.py
View file @
a11f2877
...
...
@@ -10,6 +10,7 @@ def dump_memory(signum, frame):
"""Dump memory stats for the current process to a temp directory. Uses the meliae output format."""
scanner
.
dump_all_objects
(
'{}/meliae.{}.{}.dump'
.
format
(
tempfile
.
gettempdir
(),
datetime
.
now
()
.
isoformat
(),
os
.
getpid
()))
def
install_memory_dumper
(
dump_signal
=
signal
.
SIGPROF
):
"""
Install a signal handler on `signal` to dump memory stats for the current process.
...
...
pavelib/bok_choy.py
View file @
a11f2877
...
...
@@ -95,8 +95,9 @@ def run_bokchoy(**opts):
msg
=
colorize
(
'green'
,
'Running tests using {default_store} modulestore.'
.
format
(
default_store
=
test_suite
.
default_store
)
default_store
=
test_suite
.
default_store
,
)
)
print
(
msg
)
test_suite
.
run
()
...
...
pavelib/paver_tests/test_paver_bok_choy_cmds.py
View file @
a11f2877
...
...
@@ -14,15 +14,20 @@ class TestPaverBokChoyCmd(unittest.TestCase):
def
_expected_command
(
self
,
expected_text_append
,
expected_default_store
=
None
):
if
expected_text_append
:
expected_text_append
=
"/"
+
expected_text_append
expected_statement
=
(
"DEFAULT_STORE={default_store} SCREENSHOT_DIR='{repo_dir}/test_root/log' "
"BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log/hars' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log' "
"nosetests {repo_dir}/common/test/acceptance/tests{exp_text} "
"--with-xunit "
"--xunit-file={repo_dir}/reports/bok_choy/xunit.xml "
"--verbosity=2 "
.
format
(
default_store
=
expected_default_store
,
repo_dir
=
REPO_DIR
,
exp_text
=
expected_text_append
))
expected_statement
=
(
"DEFAULT_STORE={default_store} "
"SCREENSHOT_DIR='{repo_dir}/test_root/log' "
"BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log/hars' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log' "
"nosetests {repo_dir}/common/test/acceptance/tests{exp_text} "
"--with-xunit "
"--xunit-file={repo_dir}/reports/bok_choy/xunit.xml "
"--verbosity=2 "
)
.
format
(
default_store
=
expected_default_store
,
repo_dir
=
REPO_DIR
,
exp_text
=
expected_text_append
,
)
return
expected_statement
def
test_default_bokchoy
(
self
):
...
...
pavelib/paver_tests/test_paver_quality.py
View file @
a11f2877
...
...
@@ -31,9 +31,11 @@ class TestPaverQualityViolations(unittest.TestCase):
@file_data
(
'pylint_test_list.json'
)
def
test_pylint_parser_count_violations
(
self
,
value
):
# Tests:
# * Different types of violations
# * One violation covering multiple lines
"""
Tests:
- Different types of violations
- One violation covering multiple lines
"""
with
open
(
self
.
f
.
name
,
'w'
)
as
f
:
f
.
write
(
value
)
num
=
pavelib
.
quality
.
_count_pylint_violations
(
f
.
name
)
...
...
pavelib/quality.py
View file @
a11f2877
This diff is collapsed.
Click to expand it.
pavelib/tests.py
View file @
a11f2877
...
...
@@ -204,7 +204,6 @@ def coverage(options):
dir
=
directory
))
call_task
(
'diff_coverage'
,
options
=
dict
(
options
))
...
...
pavelib/utils/test/suites/nose_suite.py
View file @
a11f2877
...
...
@@ -141,7 +141,7 @@ class SystemTestSuite(NoseTestSuite):
if
self
.
root
==
'lms'
:
default_test_id
+=
" {system}/tests.py"
.
format
(
system
=
self
.
root
)
if
self
.
root
==
'cms'
:
default_test_id
+=
" {system}/tests/*"
.
format
(
system
=
self
.
root
)
...
...
pavelib/utils/test/utils.py
View file @
a11f2877
"""
Helper functions for test tasks
"""
from
__future__
import
print_function
from
paver.easy
import
sh
,
task
,
cmdopts
from
pavelib.utils.envs
import
Env
import
os
...
...
scripts/release.py
View file @
a11f2877
...
...
@@ -98,7 +98,7 @@ def ensure_pr_fetch():
"""
modified
=
False
remotes
=
git
.
remote
()
.
splitlines
()
if
not
"edx"
in
remotes
:
if
'edx'
not
in
remotes
:
git
.
remote
(
"add"
,
"edx"
,
"https://github.com/edx/edx-platform.git"
)
modified
=
True
# it would be nice to use the git-python API to do this, but it doesn't seem
...
...
@@ -251,9 +251,9 @@ def ensure_github_creds(attempts=3):
else
:
config
=
{}
# update config
if
not
"credentials"
in
config
:
if
'credentials'
not
in
config
:
config
[
"credentials"
]
=
{}
if
not
"api.github.com"
in
config
[
"credentials"
]:
if
'api.github.com'
not
in
config
[
'credentials'
]:
config
[
"credentials"
][
"api.github.com"
]
=
{}
config
[
"credentials"
][
"api.github.com"
][
"username"
]
=
username
config
[
"credentials"
][
"api.github.com"
][
"token"
]
=
token
...
...
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