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
cf930814
Commit
cf930814
authored
Nov 08, 2014
by
stv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PEP8: E302 expected 2 blank lines, found 1
parent
d9502e48
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
102 changed files
with
117 additions
and
0 deletions
+117
-0
cms/djangoapps/contentstore/management/commands/delete_course.py
+1
-0
cms/djangoapps/contentstore/management/commands/populate_creators.py
+2
-0
cms/djangoapps/contentstore/tests/test_transcripts_utils.py
+1
-0
cms/djangoapps/contentstore/tests/test_utils.py
+1
-0
cms/djangoapps/contentstore/views/checklist.py
+1
-0
cms/djangoapps/contentstore/views/course.py
+1
-0
cms/djangoapps/contentstore/views/tabs.py
+1
-0
cms/djangoapps/models/settings/course_details.py
+1
-0
common/djangoapps/contentserver/middleware.py
+1
-0
common/djangoapps/course_groups/cohorts.py
+1
-0
common/djangoapps/course_groups/tests/test_views.py
+1
-0
common/djangoapps/django_comment_common/tests.py
+1
-0
common/djangoapps/edxmako/paths.py
+1
-0
common/djangoapps/edxmako/shortcuts.py
+2
-0
common/djangoapps/edxmako/tests.py
+1
-0
common/djangoapps/embargo/tests/test_middleware.py
+1
-0
common/djangoapps/external_auth/tests/test_ssl.py
+1
-0
common/djangoapps/heartbeat/tests/test_heartbeat.py
+1
-0
common/djangoapps/microsite_configuration/templatetags/microsite.py
+1
-0
common/djangoapps/monitoring/signals.py
+1
-0
common/djangoapps/request_cache/middleware.py
+1
-0
common/djangoapps/student/middleware.py
+1
-0
common/djangoapps/student/models.py
+4
-0
common/djangoapps/student/roles.py
+1
-0
common/djangoapps/student/tests/test_auto_auth.py
+1
-0
common/djangoapps/student/tests/test_microsite.py
+3
-0
common/djangoapps/student/tests/test_password_policy.py
+1
-0
common/djangoapps/terrain/stubs/comments.py
+1
-0
common/djangoapps/terrain/stubs/lti.py
+1
-0
common/djangoapps/terrain/stubs/tests/test_lti_stub.py
+1
-0
common/djangoapps/terrain/stubs/video_source.py
+1
-0
common/djangoapps/user_api/tests/factories.py
+1
-0
common/djangoapps/util/bad_request_rate_limiter.py
+1
-0
common/djangoapps/util/string_utils.py
+1
-0
common/djangoapps/util/tests/test_string_utils.py
+1
-0
common/lib/calc/calc/tests/test_calc.py
+1
-0
common/lib/capa/capa/registry.py
+1
-0
common/lib/capa/capa/safe_exec/lazymod.py
+1
-0
common/lib/capa/capa/tests/test_input_templates.py
+2
-0
common/lib/django_startup.py
+1
-0
common/lib/symmath/symmath/test_symmath_check.py
+1
-0
common/lib/tempdir.py
+2
-0
common/lib/xmodule/xmodule/annotator_mixin.py
+1
-0
common/lib/xmodule/xmodule/course_module.py
+2
-0
common/lib/xmodule/xmodule/lti_module.py
+1
-0
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+1
-0
common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py
+1
-0
common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py
+1
-0
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+1
-0
common/lib/xmodule/xmodule/open_ended_grading_classes/controller_query_service.py
+1
-0
common/lib/xmodule/xmodule/split_test_module.py
+1
-0
common/lib/xmodule/xmodule/tabs.py
+1
-0
common/lib/xmodule/xmodule/tests/rendering/core.py
+1
-0
common/lib/xmodule/xmodule/tests/test_bulk_assertions.py
+1
-0
common/lib/xmodule/xmodule/tests/test_capa_module.py
+1
-0
common/lib/xmodule/xmodule/tests/test_content.py
+1
-0
common/lib/xmodule/xmodule/tests/test_utils_django.py
+1
-0
common/lib/xmodule/xmodule/timeinfo.py
+1
-0
common/lib/xmodule/xmodule/video_module/transcripts_utils.py
+3
-0
common/test/acceptance/fixtures/discussion.py
+1
-0
common/test/acceptance/pages/studio/overview.py
+2
-0
common/test/acceptance/performance/test_studio_performance.py
+1
-0
common/test/data/uploads/python_lib_zip/number_helpers.py
+1
-0
docs/en_us/developers/source/conf.py
+1
-0
docs/en_us/platform_api/source/conf.py
+1
-0
docs/shared/conf.py
+1
-0
lms/djangoapps/courseware/courses.py
+1
-0
lms/djangoapps/courseware/features/events.py
+1
-0
lms/djangoapps/courseware/features/gst.py
+1
-0
lms/djangoapps/courseware/grades.py
+1
-0
lms/djangoapps/courseware/middleware.py
+1
-0
lms/djangoapps/courseware/module_render.py
+1
-0
lms/djangoapps/courseware/tests/test_access.py
+1
-0
lms/djangoapps/courseware/tests/test_microsites.py
+1
-0
lms/djangoapps/courseware/views.py
+1
-0
lms/djangoapps/dashboard/git_import.py
+1
-0
lms/djangoapps/dashboard/management/commands/git_add_course.py
+1
-0
lms/djangoapps/django_comment_client/forum/tests.py
+1
-0
lms/djangoapps/django_comment_client/tests/group_id.py
+1
-0
lms/djangoapps/django_comment_client/tests/unicode.py
+1
-0
lms/djangoapps/django_comment_client/tests/utils.py
+1
-0
lms/djangoapps/instructor/management/commands/openended_post.py
+1
-0
lms/djangoapps/instructor/offline_gradecalc.py
+1
-0
lms/djangoapps/instructor/views/legacy.py
+1
-0
lms/djangoapps/instructor_task/admin.py
+1
-0
lms/djangoapps/notification_prefs/views.py
+1
-0
lms/djangoapps/open_ended_grading/staff_grading_service.py
+1
-0
lms/djangoapps/shoppingcart/exceptions.py
+1
-0
lms/djangoapps/shoppingcart/processors/exceptions.py
+1
-0
lms/djangoapps/shoppingcart/tests/test_models.py
+1
-0
lms/djangoapps/shoppingcart/views.py
+1
-0
lms/djangoapps/staticbook/views.py
+1
-0
lms/djangoapps/verify_student/tests/test_ssencrypt.py
+2
-0
manage.py
+1
-0
pavelib/acceptance_test.py
+1
-0
pavelib/i18n.py
+1
-0
pavelib/paver_tests/test_paver_quality.py
+1
-0
pavelib/quality.py
+4
-0
pavelib/utils/envs.py
+1
-0
pavelib/utils/test/utils.py
+1
-0
scripts/run_watch_data.py
+0
-0
scripts/runone.py
+0
-0
No files found.
cms/djangoapps/contentstore/management/commands/delete_course.py
View file @
cf930814
...
@@ -9,6 +9,7 @@ from opaque_keys import InvalidKeyError
...
@@ -9,6 +9,7 @@ from opaque_keys import InvalidKeyError
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
help
=
'''Delete a MongoDB backed course'''
help
=
'''Delete a MongoDB backed course'''
...
...
cms/djangoapps/contentstore/management/commands/populate_creators.py
View file @
cf930814
...
@@ -11,6 +11,8 @@ from django.db.utils import IntegrityError
...
@@ -11,6 +11,8 @@ from django.db.utils import IntegrityError
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
#------------ to run: ./manage.py cms populate_creators --settings=dev
#------------ to run: ./manage.py cms populate_creators --settings=dev
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
"""
"""
Script for granting existing course instructors course creator privileges.
Script for granting existing course instructors course creator privileges.
...
...
cms/djangoapps/contentstore/tests/test_transcripts_utils.py
View file @
cf930814
...
@@ -472,6 +472,7 @@ class TestYoutubeTranscripts(unittest.TestCase):
...
@@ -472,6 +472,7 @@ class TestYoutubeTranscripts(unittest.TestCase):
self
.
assertEqual
(
transcripts
,
expected_transcripts
)
self
.
assertEqual
(
transcripts
,
expected_transcripts
)
mock_get
.
assert_called_with
(
'http://video.google.com/timedtext'
,
params
=
{
'lang'
:
'en'
,
'v'
:
'good_youtube_id'
})
mock_get
.
assert_called_with
(
'http://video.google.com/timedtext'
,
params
=
{
'lang'
:
'en'
,
'v'
:
'good_youtube_id'
})
class
TestTranscript
(
unittest
.
TestCase
):
class
TestTranscript
(
unittest
.
TestCase
):
"""
"""
Tests for Transcript class e.g. different transcript conversions.
Tests for Transcript class e.g. different transcript conversions.
...
...
cms/djangoapps/contentstore/tests/test_utils.py
View file @
cf930814
...
@@ -86,6 +86,7 @@ class LMSLinksTestCase(TestCase):
...
@@ -86,6 +86,7 @@ class LMSLinksTestCase(TestCase):
link
=
utils
.
get_lms_link_for_item
(
location
)
link
=
utils
.
get_lms_link_for_item
(
location
)
self
.
assertEquals
(
link
,
"//localhost:8000/courses/mitX/101/test/jump_to/i4x://mitX/101/course/test"
)
self
.
assertEquals
(
link
,
"//localhost:8000/courses/mitX/101/test/jump_to/i4x://mitX/101/course/test"
)
class
ExtraPanelTabTestCase
(
TestCase
):
class
ExtraPanelTabTestCase
(
TestCase
):
""" Tests adding and removing extra course tabs. """
""" Tests adding and removing extra course tabs. """
...
...
cms/djangoapps/contentstore/views/checklist.py
View file @
cf930814
...
@@ -124,6 +124,7 @@ def expand_checklist_action_url(course_module, checklist):
...
@@ -124,6 +124,7 @@ def expand_checklist_action_url(course_module, checklist):
return
expanded_checklist
return
expanded_checklist
def
localize_checklist_text
(
checklist
):
def
localize_checklist_text
(
checklist
):
"""
"""
Localize texts for a given checklist and returns the modified version.
Localize texts for a given checklist and returns the modified version.
...
...
cms/djangoapps/contentstore/views/course.py
View file @
cf930814
...
@@ -261,6 +261,7 @@ def course_rerun_handler(request, course_key_string):
...
@@ -261,6 +261,7 @@ def course_rerun_handler(request, course_key_string):
'allow_unicode_course_id'
:
settings
.
FEATURES
.
get
(
'ALLOW_UNICODE_COURSE_ID'
,
False
)
'allow_unicode_course_id'
:
settings
.
FEATURES
.
get
(
'ALLOW_UNICODE_COURSE_ID'
,
False
)
})
})
def
_course_outline_json
(
request
,
course_module
):
def
_course_outline_json
(
request
,
course_module
):
"""
"""
Returns a JSON representation of the course module and recursively all of its children.
Returns a JSON representation of the course module and recursively all of its children.
...
...
cms/djangoapps/contentstore/views/tabs.py
View file @
cf930814
...
@@ -20,6 +20,7 @@ from ..utils import get_lms_link_for_item
...
@@ -20,6 +20,7 @@ from ..utils import get_lms_link_for_item
__all__
=
[
'tabs_handler'
]
__all__
=
[
'tabs_handler'
]
@expect_json
@expect_json
@login_required
@login_required
@ensure_csrf_cookie
@ensure_csrf_cookie
...
...
cms/djangoapps/models/settings/course_details.py
View file @
cf930814
...
@@ -11,6 +11,7 @@ from models.settings import course_grading
...
@@ -11,6 +11,7 @@ from models.settings import course_grading
from
xmodule.fields
import
Date
from
xmodule.fields
import
Date
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
class
CourseDetails
(
object
):
class
CourseDetails
(
object
):
def
__init__
(
self
,
org
,
course_id
,
run
):
def
__init__
(
self
,
org
,
course_id
,
run
):
# still need these for now b/c the client's screen shows these 3 fields
# still need these for now b/c the client's screen shows these 3 fields
...
...
common/djangoapps/contentserver/middleware.py
View file @
cf930814
...
@@ -22,6 +22,7 @@ from xmodule.exceptions import NotFoundError
...
@@ -22,6 +22,7 @@ from xmodule.exceptions import NotFoundError
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
class
StaticContentServer
(
object
):
class
StaticContentServer
(
object
):
def
process_request
(
self
,
request
):
def
process_request
(
self
,
request
):
# look to see if the request is prefixed with an asset prefix tag
# look to see if the request is prefixed with an asset prefix tag
...
...
common/djangoapps/course_groups/cohorts.py
View file @
cf930814
...
@@ -322,6 +322,7 @@ def add_cohort(course_key, name):
...
@@ -322,6 +322,7 @@ def add_cohort(course_key, name):
)
)
return
cohort
return
cohort
def
add_user_to_cohort
(
cohort
,
username_or_email
):
def
add_user_to_cohort
(
cohort
,
username_or_email
):
"""
"""
Look up the given user, and if successful, add them to the specified cohort.
Look up the given user, and if successful, add them to the specified cohort.
...
...
common/djangoapps/course_groups/tests/test_views.py
View file @
cf930814
...
@@ -209,6 +209,7 @@ class ListCohortsTestCase(CohortViewsTestCase):
...
@@ -209,6 +209,7 @@ class ListCohortsTestCase(CohortViewsTestCase):
actual_cohorts
,
actual_cohorts
,
)
)
class
AddCohortTestCase
(
CohortViewsTestCase
):
class
AddCohortTestCase
(
CohortViewsTestCase
):
"""
"""
Tests the `add_cohort` view.
Tests the `add_cohort` view.
...
...
common/djangoapps/django_comment_common/tests.py
View file @
cf930814
...
@@ -4,6 +4,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
...
@@ -4,6 +4,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
from
django_comment_common.models
import
Role
from
django_comment_common.models
import
Role
from
student.models
import
CourseEnrollment
,
User
from
student.models
import
CourseEnrollment
,
User
class
RoleAssignmentTest
(
TestCase
):
class
RoleAssignmentTest
(
TestCase
):
"""
"""
Basic checks to make sure our Roles get assigned and unassigned as students
Basic checks to make sure our Roles get assigned and unassigned as students
...
...
common/djangoapps/edxmako/paths.py
View file @
cf930814
...
@@ -32,6 +32,7 @@ def clear_lookups(namespace):
...
@@ -32,6 +32,7 @@ def clear_lookups(namespace):
if
namespace
in
LOOKUP
:
if
namespace
in
LOOKUP
:
del
LOOKUP
[
namespace
]
del
LOOKUP
[
namespace
]
def
add_lookup
(
namespace
,
directory
,
package
=
None
,
prepend
=
False
):
def
add_lookup
(
namespace
,
directory
,
package
=
None
,
prepend
=
False
):
"""
"""
Adds a new mako template lookup directory to the given namespace.
Adds a new mako template lookup directory to the given namespace.
...
...
common/djangoapps/edxmako/shortcuts.py
View file @
cf930814
...
@@ -76,6 +76,7 @@ def marketing_link_context_processor(request):
...
@@ -76,6 +76,7 @@ def marketing_link_context_processor(request):
]
]
)
)
def
open_source_footer_context_processor
(
request
):
def
open_source_footer_context_processor
(
request
):
"""
"""
Checks the site name to determine whether to use the edX.org footer or the Open Source Footer.
Checks the site name to determine whether to use the edX.org footer or the Open Source Footer.
...
@@ -97,6 +98,7 @@ def microsite_footer_context_processor(request):
...
@@ -97,6 +98,7 @@ def microsite_footer_context_processor(request):
]
]
)
)
def
render_to_string
(
template_name
,
dictionary
,
context
=
None
,
namespace
=
'main'
):
def
render_to_string
(
template_name
,
dictionary
,
context
=
None
,
namespace
=
'main'
):
# see if there is an override template defined in the microsite
# see if there is an override template defined in the microsite
...
...
common/djangoapps/edxmako/tests.py
View file @
cf930814
...
@@ -19,6 +19,7 @@ from edxmako.shortcuts import (
...
@@ -19,6 +19,7 @@ from edxmako.shortcuts import (
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
util.testing
import
UrlResetMixin
from
util.testing
import
UrlResetMixin
@ddt.ddt
@ddt.ddt
class
ShortcutsTests
(
UrlResetMixin
,
TestCase
):
class
ShortcutsTests
(
UrlResetMixin
,
TestCase
):
"""
"""
...
...
common/djangoapps/embargo/tests/test_middleware.py
View file @
cf930814
...
@@ -28,6 +28,7 @@ from embargo.models import EmbargoedCourse, EmbargoedState, IPFilter
...
@@ -28,6 +28,7 @@ from embargo.models import EmbargoedCourse, EmbargoedState, IPFilter
# that disables the XML modulestore.
# that disables the XML modulestore.
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
@ddt.ddt
@ddt.ddt
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
...
...
common/djangoapps/external_auth/tests/test_ssl.py
View file @
cf930814
...
@@ -37,6 +37,7 @@ FEATURES_WITHOUT_SSL_AUTH['AUTH_USE_CERTIFICATES'] = False
...
@@ -37,6 +37,7 @@ FEATURES_WITHOUT_SSL_AUTH['AUTH_USE_CERTIFICATES'] = False
TEST_DATA_MIXED_MODULESTORE
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{})
TEST_DATA_MIXED_MODULESTORE
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{})
@override_settings
(
FEATURES
=
FEATURES_WITH_SSL_AUTH
)
@override_settings
(
FEATURES
=
FEATURES_WITH_SSL_AUTH
)
class
SSLClientTest
(
ModuleStoreTestCase
):
class
SSLClientTest
(
ModuleStoreTestCase
):
"""
"""
...
...
common/djangoapps/heartbeat/tests/test_heartbeat.py
View file @
cf930814
...
@@ -8,6 +8,7 @@ from django.db.utils import DatabaseError
...
@@ -8,6 +8,7 @@ from django.db.utils import DatabaseError
import
mock
import
mock
from
django.test.testcases
import
TestCase
from
django.test.testcases
import
TestCase
class
HeartbeatTestCase
(
TestCase
):
class
HeartbeatTestCase
(
TestCase
):
"""
"""
Test the heartbeat
Test the heartbeat
...
...
common/djangoapps/microsite_configuration/templatetags/microsite.py
View file @
cf930814
...
@@ -23,6 +23,7 @@ def page_title_breadcrumbs(*crumbs, **kwargs):
...
@@ -23,6 +23,7 @@ def page_title_breadcrumbs(*crumbs, **kwargs):
else
:
else
:
return
platform_name
()
return
platform_name
()
@register.simple_tag
(
name
=
"page_title_breadcrumbs"
,
takes_context
=
True
)
@register.simple_tag
(
name
=
"page_title_breadcrumbs"
,
takes_context
=
True
)
def
page_title_breadcrumbs_tag
(
context
,
*
crumbs
):
def
page_title_breadcrumbs_tag
(
context
,
*
crumbs
):
"""
"""
...
...
common/djangoapps/monitoring/signals.py
View file @
cf930814
...
@@ -78,6 +78,7 @@ def post_save_metrics(sender, **kwargs):
...
@@ -78,6 +78,7 @@ def post_save_metrics(sender, **kwargs):
tags
=
_database_tags
(
action
,
sender
,
kwargs
)
tags
=
_database_tags
(
action
,
sender
,
kwargs
)
dog_stats_api
.
increment
(
'edxapp.db.model'
,
tags
=
tags
)
dog_stats_api
.
increment
(
'edxapp.db.model'
,
tags
=
tags
)
@receiver
(
post_delete
,
dispatch_uid
=
'edxapp.monitoring.post_delete_metrics'
)
@receiver
(
post_delete
,
dispatch_uid
=
'edxapp.monitoring.post_delete_metrics'
)
def
post_delete_metrics
(
sender
,
**
kwargs
):
def
post_delete_metrics
(
sender
,
**
kwargs
):
"""
"""
...
...
common/djangoapps/request_cache/middleware.py
View file @
cf930814
...
@@ -3,6 +3,7 @@ import threading
...
@@ -3,6 +3,7 @@ import threading
_request_cache_threadlocal
=
threading
.
local
()
_request_cache_threadlocal
=
threading
.
local
()
_request_cache_threadlocal
.
data
=
{}
_request_cache_threadlocal
.
data
=
{}
class
RequestCache
(
object
):
class
RequestCache
(
object
):
@classmethod
@classmethod
def
get_request_cache
(
cls
):
def
get_request_cache
(
cls
):
...
...
common/djangoapps/student/middleware.py
View file @
cf930814
...
@@ -7,6 +7,7 @@ from django.utils.translation import ugettext as _
...
@@ -7,6 +7,7 @@ from django.utils.translation import ugettext as _
from
django.conf
import
settings
from
django.conf
import
settings
from
student.models
import
UserStanding
from
student.models
import
UserStanding
class
UserStandingMiddleware
(
object
):
class
UserStandingMiddleware
(
object
):
"""
"""
Checks a user's standing on request. Returns a 403 if the user's
Checks a user's standing on request. Returns a 403 if the user's
...
...
common/djangoapps/student/models.py
View file @
cf930814
...
@@ -665,15 +665,19 @@ class LoginFailures(models.Model):
...
@@ -665,15 +665,19 @@ class LoginFailures(models.Model):
class
CourseEnrollmentException
(
Exception
):
class
CourseEnrollmentException
(
Exception
):
pass
pass
class
NonExistentCourseError
(
CourseEnrollmentException
):
class
NonExistentCourseError
(
CourseEnrollmentException
):
pass
pass
class
EnrollmentClosedError
(
CourseEnrollmentException
):
class
EnrollmentClosedError
(
CourseEnrollmentException
):
pass
pass
class
CourseFullError
(
CourseEnrollmentException
):
class
CourseFullError
(
CourseEnrollmentException
):
pass
pass
class
AlreadyEnrolledError
(
CourseEnrollmentException
):
class
AlreadyEnrolledError
(
CourseEnrollmentException
):
pass
pass
...
...
common/djangoapps/student/roles.py
View file @
cf930814
...
@@ -210,6 +210,7 @@ class CourseFinanceAdminRole(CourseRole):
...
@@ -210,6 +210,7 @@ class CourseFinanceAdminRole(CourseRole):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
CourseFinanceAdminRole
,
self
)
.
__init__
(
self
.
ROLE
,
*
args
,
**
kwargs
)
super
(
CourseFinanceAdminRole
,
self
)
.
__init__
(
self
.
ROLE
,
*
args
,
**
kwargs
)
class
CourseBetaTesterRole
(
CourseRole
):
class
CourseBetaTesterRole
(
CourseRole
):
"""A course Beta Tester"""
"""A course Beta Tester"""
ROLE
=
'beta_testers'
ROLE
=
'beta_testers'
...
...
common/djangoapps/student/tests/test_auto_auth.py
View file @
cf930814
...
@@ -11,6 +11,7 @@ from opaque_keys.edx.locator import CourseLocator
...
@@ -11,6 +11,7 @@ from opaque_keys.edx.locator import CourseLocator
from
mock
import
patch
from
mock
import
patch
import
ddt
import
ddt
@ddt.ddt
@ddt.ddt
class
AutoAuthEnabledTestCase
(
UrlResetMixin
,
TestCase
):
class
AutoAuthEnabledTestCase
(
UrlResetMixin
,
TestCase
):
"""
"""
...
...
common/djangoapps/student/tests/test_microsite.py
View file @
cf930814
...
@@ -25,6 +25,7 @@ FAKE_MICROSITE = {
...
@@ -25,6 +25,7 @@ FAKE_MICROSITE = {
]
]
}
}
def
fake_site_name
(
name
,
default
=
None
):
# pylint: disable=W0613
def
fake_site_name
(
name
,
default
=
None
):
# pylint: disable=W0613
"""
"""
create a fake microsite site name
create a fake microsite site name
...
@@ -34,12 +35,14 @@ def fake_site_name(name, default=None): # pylint: disable=W0613
...
@@ -34,12 +35,14 @@ def fake_site_name(name, default=None): # pylint: disable=W0613
else
:
else
:
return
default
return
default
def
fake_microsite_get_value
(
name
,
default
=
None
):
# pylint: disable=W0613
def
fake_microsite_get_value
(
name
,
default
=
None
):
# pylint: disable=W0613
"""
"""
create a fake microsite site name
create a fake microsite site name
"""
"""
return
FAKE_MICROSITE
.
get
(
name
,
default
)
return
FAKE_MICROSITE
.
get
(
name
,
default
)
class
TestMicrosite
(
TestCase
):
class
TestMicrosite
(
TestCase
):
"""Test for Account Creation from a white labeled Micro-Sites"""
"""Test for Account Creation from a white labeled Micro-Sites"""
def
setUp
(
self
):
def
setUp
(
self
):
...
...
common/djangoapps/student/tests/test_password_policy.py
View file @
cf930814
...
@@ -15,6 +15,7 @@ from edxmako.tests import mako_middleware_process_request
...
@@ -15,6 +15,7 @@ from edxmako.tests import mako_middleware_process_request
from
external_auth.models
import
ExternalAuthMap
from
external_auth.models
import
ExternalAuthMap
from
student.views
import
create_account
from
student.views
import
create_account
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ENFORCE_PASSWORD_POLICY'
:
True
})
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ENFORCE_PASSWORD_POLICY'
:
True
})
class
TestPasswordPolicy
(
TestCase
):
class
TestPasswordPolicy
(
TestCase
):
"""
"""
...
...
common/djangoapps/terrain/stubs/comments.py
View file @
cf930814
...
@@ -6,6 +6,7 @@ import re
...
@@ -6,6 +6,7 @@ import re
import
urlparse
import
urlparse
from
.http
import
StubHttpRequestHandler
,
StubHttpService
from
.http
import
StubHttpRequestHandler
,
StubHttpService
class
StubCommentsServiceHandler
(
StubHttpRequestHandler
):
class
StubCommentsServiceHandler
(
StubHttpRequestHandler
):
@property
@property
...
...
common/djangoapps/terrain/stubs/lti.py
View file @
cf930814
...
@@ -21,6 +21,7 @@ import mock
...
@@ -21,6 +21,7 @@ import mock
import
requests
import
requests
from
http
import
StubHttpRequestHandler
,
StubHttpService
from
http
import
StubHttpRequestHandler
,
StubHttpService
class
StubLtiHandler
(
StubHttpRequestHandler
):
class
StubLtiHandler
(
StubHttpRequestHandler
):
"""
"""
A handler for LTI POST and GET requests.
A handler for LTI POST and GET requests.
...
...
common/djangoapps/terrain/stubs/tests/test_lti_stub.py
View file @
cf930814
...
@@ -7,6 +7,7 @@ import urllib2
...
@@ -7,6 +7,7 @@ import urllib2
import
requests
import
requests
from
terrain.stubs.lti
import
StubLtiService
from
terrain.stubs.lti
import
StubLtiService
class
StubLtiServiceTest
(
unittest
.
TestCase
):
class
StubLtiServiceTest
(
unittest
.
TestCase
):
"""
"""
A stub of the LTI provider that listens on a local
A stub of the LTI provider that listens on a local
...
...
common/djangoapps/terrain/stubs/video_source.py
View file @
cf930814
...
@@ -9,6 +9,7 @@ import os
...
@@ -9,6 +9,7 @@ import os
from
logging
import
getLogger
from
logging
import
getLogger
LOGGER
=
getLogger
(
__name__
)
LOGGER
=
getLogger
(
__name__
)
class
VideoSourceRequestHandler
(
SimpleHTTPRequestHandler
):
class
VideoSourceRequestHandler
(
SimpleHTTPRequestHandler
):
"""
"""
Request handler for serving video sources locally.
Request handler for serving video sources locally.
...
...
common/djangoapps/user_api/tests/factories.py
View file @
cf930814
...
@@ -5,6 +5,7 @@ from student.tests.factories import UserFactory
...
@@ -5,6 +5,7 @@ from student.tests.factories import UserFactory
from
user_api.models
import
UserPreference
,
UserCourseTag
from
user_api.models
import
UserPreference
,
UserCourseTag
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
# Factories don't have __init__ methods, and are self documenting
# Factories don't have __init__ methods, and are self documenting
# pylint: disable=W0232, C0111
# pylint: disable=W0232, C0111
class
UserPreferenceFactory
(
DjangoModelFactory
):
class
UserPreferenceFactory
(
DjangoModelFactory
):
...
...
common/djangoapps/util/bad_request_rate_limiter.py
View file @
cf930814
...
@@ -4,6 +4,7 @@ which can be used for rate limiting
...
@@ -4,6 +4,7 @@ which can be used for rate limiting
"""
"""
from
ratelimitbackend.backends
import
RateLimitMixin
from
ratelimitbackend.backends
import
RateLimitMixin
class
BadRequestRateLimiter
(
RateLimitMixin
):
class
BadRequestRateLimiter
(
RateLimitMixin
):
"""
"""
Use the 3rd party RateLimitMixin to help do rate limiting on the Password Reset flows
Use the 3rd party RateLimitMixin to help do rate limiting on the Password Reset flows
...
...
common/djangoapps/util/string_utils.py
View file @
cf930814
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
Utilities for string manipulation.
Utilities for string manipulation.
"""
"""
def
str_to_bool
(
str
):
def
str_to_bool
(
str
):
"""
"""
Converts "true" (case-insensitive) to the boolean True.
Converts "true" (case-insensitive) to the boolean True.
...
...
common/djangoapps/util/tests/test_string_utils.py
View file @
cf930814
...
@@ -5,6 +5,7 @@ Tests for string_utils.py
...
@@ -5,6 +5,7 @@ Tests for string_utils.py
from
django.test
import
TestCase
from
django.test
import
TestCase
from
util.string_utils
import
str_to_bool
from
util.string_utils
import
str_to_bool
class
StringUtilsTest
(
TestCase
):
class
StringUtilsTest
(
TestCase
):
"""
"""
Tests for str_to_bool.
Tests for str_to_bool.
...
...
common/lib/calc/calc/tests/test_calc.py
View file @
cf930814
...
@@ -14,6 +14,7 @@ from pyparsing import ParseException
...
@@ -14,6 +14,7 @@ from pyparsing import ParseException
# See http://docs.scipy.org/doc/numpy/reference/generated/numpy.seterr.html
# See http://docs.scipy.org/doc/numpy/reference/generated/numpy.seterr.html
numpy
.
seterr
(
all
=
'ignore'
)
# Also: 'ignore', 'warn' (default), 'raise'
numpy
.
seterr
(
all
=
'ignore'
)
# Also: 'ignore', 'warn' (default), 'raise'
class
EvaluatorTest
(
unittest
.
TestCase
):
class
EvaluatorTest
(
unittest
.
TestCase
):
"""
"""
Run tests for calc.evaluator
Run tests for calc.evaluator
...
...
common/lib/capa/capa/registry.py
View file @
cf930814
"""A registry for finding classes based on tags in the class."""
"""A registry for finding classes based on tags in the class."""
class
TagRegistry
(
object
):
class
TagRegistry
(
object
):
"""
"""
A registry mapping tags to handlers.
A registry mapping tags to handlers.
...
...
common/lib/capa/capa/safe_exec/lazymod.py
View file @
cf930814
...
@@ -7,6 +7,7 @@ in the public domain.
...
@@ -7,6 +7,7 @@ in the public domain.
import
sys
import
sys
class
LazyModule
(
object
):
class
LazyModule
(
object
):
"""A lazy module proxy."""
"""A lazy module proxy."""
...
...
common/lib/capa/capa/tests/test_input_templates.py
View file @
cf930814
...
@@ -11,6 +11,7 @@ from mako.template import Template as MakoTemplate
...
@@ -11,6 +11,7 @@ from mako.template import Template as MakoTemplate
from
mako
import
exceptions
from
mako
import
exceptions
from
capa.inputtypes
import
Status
from
capa.inputtypes
import
Status
class
TemplateError
(
Exception
):
class
TemplateError
(
Exception
):
"""
"""
Error occurred while rendering a Mako template.
Error occurred while rendering a Mako template.
...
@@ -497,6 +498,7 @@ class FormulaEquationInputTemplateTest(TemplateTestCase):
...
@@ -497,6 +498,7 @@ class FormulaEquationInputTemplateTest(TemplateTestCase):
self
.
assert_has_xpath
(
xml
,
"//input[@size='40']"
,
self
.
context
)
self
.
assert_has_xpath
(
xml
,
"//input[@size='40']"
,
self
.
context
)
class
AnnotationInputTemplateTest
(
TemplateTestCase
):
class
AnnotationInputTemplateTest
(
TemplateTestCase
):
"""
"""
Test mako template for `<annotationinput>` input.
Test mako template for `<annotationinput>` input.
...
...
common/lib/django_startup.py
View file @
cf930814
...
@@ -5,6 +5,7 @@ Automatic execution of startup modules in Django apps.
...
@@ -5,6 +5,7 @@ Automatic execution of startup modules in Django apps.
from
importlib
import
import_module
from
importlib
import
import_module
from
django.conf
import
settings
from
django.conf
import
settings
def
autostartup
():
def
autostartup
():
"""
"""
Execute app.startup:run() for all installed django apps
Execute app.startup:run() for all installed django apps
...
...
common/lib/symmath/symmath/test_symmath_check.py
View file @
cf930814
from
unittest
import
TestCase
from
unittest
import
TestCase
from
.symmath_check
import
symmath_check
from
.symmath_check
import
symmath_check
class
SymmathCheckTest
(
TestCase
):
class
SymmathCheckTest
(
TestCase
):
def
test_symmath_check_integers
(
self
):
def
test_symmath_check_integers
(
self
):
number_list
=
[
i
for
i
in
range
(
-
100
,
100
)]
number_list
=
[
i
for
i
in
range
(
-
100
,
100
)]
...
...
common/lib/tempdir.py
View file @
cf930814
...
@@ -5,12 +5,14 @@ import os.path
...
@@ -5,12 +5,14 @@ import os.path
import
shutil
import
shutil
import
tempfile
import
tempfile
def
mkdtemp_clean
(
suffix
=
""
,
prefix
=
"tmp"
,
dir
=
None
):
def
mkdtemp_clean
(
suffix
=
""
,
prefix
=
"tmp"
,
dir
=
None
):
"""Just like mkdtemp, but the directory will be deleted when the process ends."""
"""Just like mkdtemp, but the directory will be deleted when the process ends."""
the_dir
=
tempfile
.
mkdtemp
(
suffix
=
suffix
,
prefix
=
prefix
,
dir
=
dir
)
the_dir
=
tempfile
.
mkdtemp
(
suffix
=
suffix
,
prefix
=
prefix
,
dir
=
dir
)
atexit
.
register
(
cleanup_tempdir
,
the_dir
)
atexit
.
register
(
cleanup_tempdir
,
the_dir
)
return
the_dir
return
the_dir
def
cleanup_tempdir
(
the_dir
):
def
cleanup_tempdir
(
the_dir
):
"""Called on process exit to remove a temp directory."""
"""Called on process exit to remove a temp directory."""
if
os
.
path
.
exists
(
the_dir
):
if
os
.
path
.
exists
(
the_dir
):
...
...
common/lib/xmodule/xmodule/annotator_mixin.py
View file @
cf930814
...
@@ -7,6 +7,7 @@ from urlparse import urlparse
...
@@ -7,6 +7,7 @@ from urlparse import urlparse
from
os.path
import
splitext
,
basename
from
os.path
import
splitext
,
basename
from
HTMLParser
import
HTMLParser
from
HTMLParser
import
HTMLParser
def
get_instructions
(
xmltree
):
def
get_instructions
(
xmltree
):
""" Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
""" Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
instructions
=
xmltree
.
find
(
'instructions'
)
instructions
=
xmltree
.
find
(
'instructions'
)
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
cf930814
...
@@ -28,6 +28,7 @@ CATALOG_VISIBILITY_CATALOG_AND_ABOUT = "both"
...
@@ -28,6 +28,7 @@ CATALOG_VISIBILITY_CATALOG_AND_ABOUT = "both"
CATALOG_VISIBILITY_ABOUT
=
"about"
CATALOG_VISIBILITY_ABOUT
=
"about"
CATALOG_VISIBILITY_NONE
=
"none"
CATALOG_VISIBILITY_NONE
=
"none"
class
StringOrDate
(
Date
):
class
StringOrDate
(
Date
):
def
from_json
(
self
,
value
):
def
from_json
(
self
,
value
):
"""
"""
...
@@ -589,6 +590,7 @@ class CourseFields(object):
...
@@ -589,6 +590,7 @@ class CourseFields(object):
{
"display_name"
:
_
(
"None"
),
"value"
:
CATALOG_VISIBILITY_NONE
}]
{
"display_name"
:
_
(
"None"
),
"value"
:
CATALOG_VISIBILITY_NONE
}]
)
)
class
CourseDescriptor
(
CourseFields
,
SequenceDescriptor
):
class
CourseDescriptor
(
CourseFields
,
SequenceDescriptor
):
module_class
=
SequenceModule
module_class
=
SequenceModule
...
...
common/lib/xmodule/xmodule/lti_module.py
View file @
cf930814
...
@@ -842,6 +842,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
...
@@ -842,6 +842,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
return
key
,
secret
return
key
,
secret
return
''
,
''
return
''
,
''
class
LTIDescriptor
(
LTIFields
,
MetadataOnlyEditingDescriptor
,
EmptyDataRawDescriptor
):
class
LTIDescriptor
(
LTIFields
,
MetadataOnlyEditingDescriptor
,
EmptyDataRawDescriptor
):
"""
"""
Descriptor for LTI Xmodule.
Descriptor for LTI Xmodule.
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
cf930814
...
@@ -2690,6 +2690,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
...
@@ -2690,6 +2690,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
"""
"""
self
.
db_connection
.
ensure_indexes
()
self
.
db_connection
.
ensure_indexes
()
class
SparseList
(
list
):
class
SparseList
(
list
):
"""
"""
Enable inserting items into a list in arbitrary order and then retrieving them.
Enable inserting items into a list in arbitrary order and then retrieving them.
...
...
common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py
View file @
cf930814
...
@@ -8,6 +8,7 @@ from opaque_keys.edx.keys import UsageKey
...
@@ -8,6 +8,7 @@ from opaque_keys.edx.keys import UsageKey
# Factories don't have __init__ methods, and are self documenting
# Factories don't have __init__ methods, and are self documenting
# pylint: disable=W0232, C0111
# pylint: disable=W0232, C0111
class
SplitFactory
(
factory
.
Factory
):
class
SplitFactory
(
factory
.
Factory
):
"""
"""
Abstracted superclass which defines modulestore so that there's no dependency on django
Abstracted superclass which defines modulestore so that there's no dependency on django
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py
View file @
cf930814
...
@@ -12,6 +12,7 @@ from xmodule.modulestore.modulestore_settings import (
...
@@ -12,6 +12,7 @@ from xmodule.modulestore.modulestore_settings import (
get_mixed_stores
,
get_mixed_stores
,
)
)
@ddt.ddt
@ddt.ddt
class
ModuleStoreSettingsMigration
(
TestCase
):
class
ModuleStoreSettingsMigration
(
TestCase
):
"""
"""
...
...
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
cf930814
...
@@ -390,6 +390,7 @@ def _import_static_content_wrapper(static_content_store, do_import_static, cours
...
@@ -390,6 +390,7 @@ def _import_static_content_wrapper(static_content_store, do_import_static, cours
dest_course_id
,
subpath
=
simport
,
verbose
=
verbose
dest_course_id
,
subpath
=
simport
,
verbose
=
verbose
)
)
def
_import_module_and_update_references
(
def
_import_module_and_update_references
(
module
,
store
,
user_id
,
module
,
store
,
user_id
,
source_course_id
,
dest_course_id
,
source_course_id
,
dest_course_id
,
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/controller_query_service.py
View file @
cf930814
...
@@ -168,6 +168,7 @@ class MockControllerQueryService(object):
...
@@ -168,6 +168,7 @@ class MockControllerQueryService(object):
"""
"""
pass
pass
def
convert_seconds_to_human_readable
(
seconds
):
def
convert_seconds_to_human_readable
(
seconds
):
if
seconds
<
60
:
if
seconds
<
60
:
human_string
=
"{0} seconds"
.
format
(
seconds
)
human_string
=
"{0} seconds"
.
format
(
seconds
)
...
...
common/lib/xmodule/xmodule/split_test_module.py
View file @
cf930814
...
@@ -357,6 +357,7 @@ class SplitTestModule(SplitTestFields, XModule, StudioEditableModule):
...
@@ -357,6 +357,7 @@ class SplitTestModule(SplitTestFields, XModule, StudioEditableModule):
"""
"""
return
self
.
descriptor
.
validate
()
return
self
.
descriptor
.
validate
()
@XBlock.needs
(
'user_tags'
)
# pylint: disable=abstract-method
@XBlock.needs
(
'user_tags'
)
# pylint: disable=abstract-method
@XBlock.wants
(
'partitions'
)
@XBlock.wants
(
'partitions'
)
@XBlock.wants
(
'user'
)
@XBlock.wants
(
'user'
)
...
...
common/lib/xmodule/xmodule/tabs.py
View file @
cf930814
...
@@ -225,6 +225,7 @@ class StaffTab(AuthenticatedCourseTab):
...
@@ -225,6 +225,7 @@ class StaffTab(AuthenticatedCourseTab):
def
can_display
(
self
,
course
,
settings
,
is_user_authenticated
,
is_user_staff
,
is_user_enrolled
):
# pylint: disable=unused-argument
def
can_display
(
self
,
course
,
settings
,
is_user_authenticated
,
is_user_staff
,
is_user_enrolled
):
# pylint: disable=unused-argument
return
is_user_staff
return
is_user_staff
class
EnrolledOrStaffTab
(
CourseTab
):
class
EnrolledOrStaffTab
(
CourseTab
):
"""
"""
Abstract class for tabs that can be accessed by only users with staff access
Abstract class for tabs that can be accessed by only users with staff access
...
...
common/lib/xmodule/xmodule/tests/rendering/core.py
View file @
cf930814
...
@@ -40,6 +40,7 @@ import lxml.etree
...
@@ -40,6 +40,7 @@ import lxml.etree
from
singledispatch
import
singledispatch
from
singledispatch
import
singledispatch
@singledispatch
@singledispatch
def
assert_student_view_valid_html
(
block
,
html
):
def
assert_student_view_valid_html
(
block
,
html
):
"""
"""
...
...
common/lib/xmodule/xmodule/tests/test_bulk_assertions.py
View file @
cf930814
import
ddt
import
ddt
from
xmodule.tests
import
BulkAssertionTest
from
xmodule.tests
import
BulkAssertionTest
@ddt.ddt
@ddt.ddt
class
TestBulkAssertionTestCase
(
BulkAssertionTest
):
class
TestBulkAssertionTestCase
(
BulkAssertionTest
):
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
cf930814
...
@@ -142,6 +142,7 @@ class CapaFactory(object):
...
@@ -142,6 +142,7 @@ class CapaFactory(object):
return
module
return
module
class
CapaFactoryWithFiles
(
CapaFactory
):
class
CapaFactoryWithFiles
(
CapaFactory
):
"""
"""
A factory for creating a Capa problem with files attached.
A factory for creating a Capa problem with files attached.
...
...
common/lib/xmodule/xmodule/tests/test_content.py
View file @
cf930814
...
@@ -44,6 +44,7 @@ Various versions have evolved over the years, sometimes by accident, sometimes o
...
@@ -44,6 +44,7 @@ Various versions have evolved over the years, sometimes by accident, sometimes o
injected humour and the like).
injected humour and the like).
"""
"""
class
Content
:
class
Content
:
def
__init__
(
self
,
location
,
content_type
):
def
__init__
(
self
,
location
,
content_type
):
self
.
location
=
location
self
.
location
=
location
...
...
common/lib/xmodule/xmodule/tests/test_utils_django.py
View file @
cf930814
...
@@ -3,6 +3,7 @@ from xmodule.util.django import get_current_request, get_current_request_hostnam
...
@@ -3,6 +3,7 @@ from xmodule.util.django import get_current_request, get_current_request_hostnam
from
nose.tools
import
assert_is_none
from
nose.tools
import
assert_is_none
from
unittest
import
TestCase
from
unittest
import
TestCase
class
UtilDjangoTests
(
TestCase
):
class
UtilDjangoTests
(
TestCase
):
"""
"""
Tests for methods exposed in util/django
Tests for methods exposed in util/django
...
...
common/lib/xmodule/xmodule/timeinfo.py
View file @
cf930814
...
@@ -2,6 +2,7 @@ import logging
...
@@ -2,6 +2,7 @@ import logging
from
xmodule.fields
import
Timedelta
from
xmodule.fields
import
Timedelta
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
class
TimeInfo
(
object
):
class
TimeInfo
(
object
):
"""
"""
This is a simple object that calculates and stores datetime information for an XModule
This is a simple object that calculates and stores datetime information for an XModule
...
...
common/lib/xmodule/xmodule/video_module/transcripts_utils.py
View file @
cf930814
...
@@ -75,6 +75,7 @@ def save_to_store(content, name, mime_type, location):
...
@@ -75,6 +75,7 @@ def save_to_store(content, name, mime_type, location):
contentstore
()
.
save
(
content
)
contentstore
()
.
save
(
content
)
return
content_location
return
content_location
def
save_subs_to_store
(
subs
,
subs_id
,
item
,
language
=
'en'
):
def
save_subs_to_store
(
subs
,
subs_id
,
item
,
language
=
'en'
):
"""
"""
Save transcripts into `StaticContent`.
Save transcripts into `StaticContent`.
...
@@ -90,6 +91,7 @@ def save_subs_to_store(subs, subs_id, item, language='en'):
...
@@ -90,6 +91,7 @@ def save_subs_to_store(subs, subs_id, item, language='en'):
filename
=
subs_filename
(
subs_id
,
language
)
filename
=
subs_filename
(
subs_id
,
language
)
return
save_to_store
(
filedata
,
filename
,
'application/json'
,
item
.
location
)
return
save_to_store
(
filedata
,
filename
,
'application/json'
,
item
.
location
)
def
get_transcripts_from_youtube
(
youtube_id
,
settings
,
i18n
):
def
get_transcripts_from_youtube
(
youtube_id
,
settings
,
i18n
):
"""
"""
Gets transcripts from youtube for youtube_id.
Gets transcripts from youtube for youtube_id.
...
@@ -428,6 +430,7 @@ def get_or_create_sjson(item):
...
@@ -428,6 +430,7 @@ def get_or_create_sjson(item):
sjson_transcript
=
Transcript
.
asset
(
item
.
location
,
source_subs_id
,
item
.
transcript_language
)
.
data
sjson_transcript
=
Transcript
.
asset
(
item
.
location
,
source_subs_id
,
item
.
transcript_language
)
.
data
return
sjson_transcript
return
sjson_transcript
class
Transcript
(
object
):
class
Transcript
(
object
):
"""
"""
Container for transcript methods.
Container for transcript methods.
...
...
common/test/acceptance/fixtures/discussion.py
View file @
cf930814
...
@@ -42,6 +42,7 @@ class Thread(ContentFactory):
...
@@ -42,6 +42,7 @@ class Thread(ContentFactory):
pinned
=
False
pinned
=
False
read
=
False
read
=
False
class
Comment
(
ContentFactory
):
class
Comment
(
ContentFactory
):
thread_id
=
None
thread_id
=
None
depth
=
0
depth
=
0
...
...
common/test/acceptance/pages/studio/overview.py
View file @
cf930814
...
@@ -307,6 +307,7 @@ class CourseOutlineChild(PageObject, CourseOutlineItem):
...
@@ -307,6 +307,7 @@ class CourseOutlineChild(PageObject, CourseOutlineItem):
grand_locators
=
[
grandkid
.
locator
for
grandkid
in
grandkids
]
grand_locators
=
[
grandkid
.
locator
for
grandkid
in
grandkids
]
return
[
descendant
for
descendant
in
descendants
if
not
descendant
.
locator
in
grand_locators
]
return
[
descendant
for
descendant
in
descendants
if
not
descendant
.
locator
in
grand_locators
]
class
CourseOutlineUnit
(
CourseOutlineChild
):
class
CourseOutlineUnit
(
CourseOutlineChild
):
"""
"""
PageObject that wraps a unit link on the Studio Course Outline page.
PageObject that wraps a unit link on the Studio Course Outline page.
...
@@ -329,6 +330,7 @@ class CourseOutlineUnit(CourseOutlineChild):
...
@@ -329,6 +330,7 @@ class CourseOutlineUnit(CourseOutlineChild):
return
self
.
q
(
css
=
self
.
_bounded_selector
(
self
.
BODY_SELECTOR
))
.
map
(
return
self
.
q
(
css
=
self
.
_bounded_selector
(
self
.
BODY_SELECTOR
))
.
map
(
lambda
el
:
CourseOutlineUnit
(
self
.
browser
,
el
.
get_attribute
(
'data-locator'
)))
.
results
lambda
el
:
CourseOutlineUnit
(
self
.
browser
,
el
.
get_attribute
(
'data-locator'
)))
.
results
class
CourseOutlineSubsection
(
CourseOutlineContainer
,
CourseOutlineChild
):
class
CourseOutlineSubsection
(
CourseOutlineContainer
,
CourseOutlineChild
):
"""
"""
:class`.PageObject` that wraps a subsection block on the Studio Course Outline page.
:class`.PageObject` that wraps a subsection block on the Studio Course Outline page.
...
...
common/test/acceptance/performance/test_studio_performance.py
View file @
cf930814
...
@@ -6,6 +6,7 @@ from ..pages.studio.auto_auth import AutoAuthPage
...
@@ -6,6 +6,7 @@ from ..pages.studio.auto_auth import AutoAuthPage
from
..pages.studio.overview
import
CourseOutlinePage
from
..pages.studio.overview
import
CourseOutlinePage
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
@attr
(
har_mode
=
'explicit'
)
@attr
(
har_mode
=
'explicit'
)
class
StudioPagePerformanceTest
(
WebAppTest
):
class
StudioPagePerformanceTest
(
WebAppTest
):
"""
"""
...
...
common/test/data/uploads/python_lib_zip/number_helpers.py
View file @
cf930814
def
seventeen
():
def
seventeen
():
return
17
return
17
def
fortytwo
(
x
):
def
fortytwo
(
x
):
return
42
+
x
return
42
+
x
docs/en_us/developers/source/conf.py
View file @
cf930814
...
@@ -83,6 +83,7 @@ copyright = u'2014, edX'
...
@@ -83,6 +83,7 @@ copyright = u'2014, edX'
# Mock all the modules that the readthedocs build can't import
# Mock all the modules that the readthedocs build can't import
class
Mock
(
object
):
class
Mock
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
pass
...
...
docs/en_us/platform_api/source/conf.py
View file @
cf930814
...
@@ -74,6 +74,7 @@ copyright = u'2014, edX'
...
@@ -74,6 +74,7 @@ copyright = u'2014, edX'
# Mock all the modules that the readthedocs build can't import
# Mock all the modules that the readthedocs build can't import
class
Mock
(
object
):
class
Mock
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
pass
...
...
docs/shared/conf.py
View file @
cf930814
...
@@ -25,6 +25,7 @@ import sys, os
...
@@ -25,6 +25,7 @@ import sys, os
BASEDIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
BASEDIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
def
add_base
(
paths
):
def
add_base
(
paths
):
"""
"""
Returns a list of paths relative to BASEDIR.
Returns a list of paths relative to BASEDIR.
...
...
lms/djangoapps/courseware/courses.py
View file @
cf930814
...
@@ -259,6 +259,7 @@ def get_course_info_section_module(request, course, section_key):
...
@@ -259,6 +259,7 @@ def get_course_info_section_module(request, course, section_key):
static_asset_path
=
course
.
static_asset_path
static_asset_path
=
course
.
static_asset_path
)
)
def
get_course_info_section
(
request
,
course
,
section_key
):
def
get_course_info_section
(
request
,
course
,
section_key
):
"""
"""
This returns the snippet of html to be rendered on the course info page,
This returns the snippet of html to be rendered on the course info page,
...
...
lms/djangoapps/courseware/features/events.py
View file @
cf930814
...
@@ -41,6 +41,7 @@ def course_url_event_is_emitted(_step, url_regex):
...
@@ -41,6 +41,7 @@ def course_url_event_is_emitted(_step, url_regex):
event_type
=
url_regex
.
format
(
world
.
scenario_dict
[
'COURSE'
]
.
id
)
event_type
=
url_regex
.
format
(
world
.
scenario_dict
[
'COURSE'
]
.
id
)
n_events_are_emitted
(
_step
,
1
,
event_type
,
"server"
)
n_events_are_emitted
(
_step
,
1
,
event_type
,
"server"
)
@step
(
r'([aA]n?|\d+) "(.*)" (server|browser) events? is emitted$'
)
@step
(
r'([aA]n?|\d+) "(.*)" (server|browser) events? is emitted$'
)
def
n_events_are_emitted
(
_step
,
count
,
event_type
,
event_source
):
def
n_events_are_emitted
(
_step
,
count
,
event_type
,
event_source
):
...
...
lms/djangoapps/courseware/features/gst.py
View file @
cf930814
...
@@ -26,6 +26,7 @@ DEFAULT_DATA = """\
...
@@ -26,6 +26,7 @@ DEFAULT_DATA = """\
</configuration>
</configuration>
"""
"""
@steps
@steps
class
GraphicalSliderToolSteps
(
object
):
class
GraphicalSliderToolSteps
(
object
):
COURSE_NUM
=
'test_course'
COURSE_NUM
=
'test_course'
...
...
lms/djangoapps/courseware/grades.py
View file @
cf930814
...
@@ -140,6 +140,7 @@ def answer_distributions(course_key):
...
@@ -140,6 +140,7 @@ def answer_distributions(course_key):
return
answer_counts
return
answer_counts
@transaction.commit_manually
@transaction.commit_manually
def
grade
(
student
,
request
,
course
,
keep_raw_scores
=
False
):
def
grade
(
student
,
request
,
course
,
keep_raw_scores
=
False
):
"""
"""
...
...
lms/djangoapps/courseware/middleware.py
View file @
cf930814
...
@@ -7,6 +7,7 @@ from django.core.urlresolvers import reverse
...
@@ -7,6 +7,7 @@ from django.core.urlresolvers import reverse
from
courseware.courses
import
UserNotEnrolled
from
courseware.courses
import
UserNotEnrolled
class
RedirectUnenrolledMiddleware
(
object
):
class
RedirectUnenrolledMiddleware
(
object
):
"""
"""
Catch UserNotEnrolled errors thrown by `get_course_with_access` and redirect
Catch UserNotEnrolled errors thrown by `get_course_with_access` and redirect
...
...
lms/djangoapps/courseware/module_render.py
View file @
cf930814
...
@@ -72,6 +72,7 @@ XQUEUE_INTERFACE = XQueueInterface(
...
@@ -72,6 +72,7 @@ XQUEUE_INTERFACE = XQueueInterface(
# Some brave person should make the variable names consistently someday, but the code's
# Some brave person should make the variable names consistently someday, but the code's
# coupled enough that it's kind of tricky--you've been warned!
# coupled enough that it's kind of tricky--you've been warned!
class
LmsModuleRenderError
(
Exception
):
class
LmsModuleRenderError
(
Exception
):
"""
"""
An exception class for exceptions thrown by module_render that don't fit well elsewhere
An exception class for exceptions thrown by module_render that don't fit well elsewhere
...
...
lms/djangoapps/courseware/tests/test_access.py
View file @
cf930814
...
@@ -18,6 +18,7 @@ from xmodule.course_module import (
...
@@ -18,6 +18,7 @@ from xmodule.course_module import (
# pylint: disable=C0111
# pylint: disable=C0111
# pylint: disable=W0212
# pylint: disable=W0212
class
AccessTestCase
(
TestCase
):
class
AccessTestCase
(
TestCase
):
"""
"""
Tests for the various access controls on the student dashboard
Tests for the various access controls on the student dashboard
...
...
lms/djangoapps/courseware/tests/test_microsites.py
View file @
cf930814
...
@@ -14,6 +14,7 @@ from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
...
@@ -14,6 +14,7 @@ from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from
xmodule.course_module
import
(
from
xmodule.course_module
import
(
CATALOG_VISIBILITY_CATALOG_AND_ABOUT
,
CATALOG_VISIBILITY_NONE
)
CATALOG_VISIBILITY_CATALOG_AND_ABOUT
,
CATALOG_VISIBILITY_NONE
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
TestMicrosites
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestMicrosites
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
...
lms/djangoapps/courseware/views.py
View file @
cf930814
...
@@ -838,6 +838,7 @@ def mktg_course_about(request, course_id):
...
@@ -838,6 +838,7 @@ def mktg_course_about(request, course_id):
if
force_english
:
if
force_english
:
translation
.
deactivate
()
translation
.
deactivate
()
@login_required
@login_required
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
@transaction.commit_manually
@transaction.commit_manually
...
...
lms/djangoapps/dashboard/git_import.py
View file @
cf930814
...
@@ -51,6 +51,7 @@ class GitImportError(Exception):
...
@@ -51,6 +51,7 @@ class GitImportError(Exception):
CANNOT_BRANCH
=
_
(
'Unable to switch to specified branch. Please check '
CANNOT_BRANCH
=
_
(
'Unable to switch to specified branch. Please check '
'your branch name.'
)
'your branch name.'
)
def
cmd_log
(
cmd
,
cwd
):
def
cmd_log
(
cmd
,
cwd
):
"""
"""
Helper function to redirect stderr to stdout and log the command
Helper function to redirect stderr to stdout and log the command
...
...
lms/djangoapps/dashboard/management/commands/git_add_course.py
View file @
cf930814
...
@@ -14,6 +14,7 @@ from xmodule.modulestore.xml import XMLModuleStore
...
@@ -14,6 +14,7 @@ from xmodule.modulestore.xml import XMLModuleStore
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
"""
"""
Pull a git repo and import into the mongo based content database.
Pull a git repo and import into the mongo based content database.
...
...
lms/djangoapps/django_comment_client/forum/tests.py
View file @
cf930814
...
@@ -569,6 +569,7 @@ class ForumFormDiscussionGroupIdTestCase(CohortedContentTestCase, CohortedTopicG
...
@@ -569,6 +569,7 @@ class ForumFormDiscussionGroupIdTestCase(CohortedContentTestCase, CohortedTopicG
response
,
lambda
d
:
d
[
'discussion_data'
][
0
]
response
,
lambda
d
:
d
[
'discussion_data'
][
0
]
)
)
@patch
(
'lms.lib.comment_client.utils.requests.request'
)
@patch
(
'lms.lib.comment_client.utils.requests.request'
)
class
UserProfileDiscussionGroupIdTestCase
(
CohortedContentTestCase
,
CohortedTopicGroupIdTestMixin
):
class
UserProfileDiscussionGroupIdTestCase
(
CohortedContentTestCase
,
CohortedTopicGroupIdTestMixin
):
cs_endpoint
=
"/active_threads"
cs_endpoint
=
"/active_threads"
...
...
lms/djangoapps/django_comment_client/tests/group_id.py
View file @
cf930814
...
@@ -3,6 +3,7 @@ import re
...
@@ -3,6 +3,7 @@ import re
from
course_groups.models
import
CourseUserGroup
from
course_groups.models
import
CourseUserGroup
class
GroupIdAssertionMixin
(
object
):
class
GroupIdAssertionMixin
(
object
):
def
_data_or_params_cs_request
(
self
,
mock_request
):
def
_data_or_params_cs_request
(
self
,
mock_request
):
"""
"""
...
...
lms/djangoapps/django_comment_client/tests/unicode.py
View file @
cf930814
# coding=utf-8
# coding=utf-8
class
UnicodeTestMixin
(
object
):
class
UnicodeTestMixin
(
object
):
def
test_ascii
(
self
):
def
test_ascii
(
self
):
self
.
_test_unicode_data
(
u"This post contains ASCII."
)
self
.
_test_unicode_data
(
u"This post contains ASCII."
)
...
...
lms/djangoapps/django_comment_client/tests/utils.py
View file @
cf930814
...
@@ -9,6 +9,7 @@ from student.tests.factories import CourseEnrollmentFactory, UserFactory
...
@@ -9,6 +9,7 @@ from student.tests.factories import CourseEnrollmentFactory, UserFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
CohortedContentTestCase
(
ModuleStoreTestCase
):
class
CohortedContentTestCase
(
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/instructor/management/commands/openended_post.py
View file @
cf930814
...
@@ -112,6 +112,7 @@ def post_submission_for_student(student, course, location, task_number, dry_run=
...
@@ -112,6 +112,7 @@ def post_submission_for_student(student, course, location, task_number, dry_run=
return
False
return
False
class
DummyRequest
(
object
):
class
DummyRequest
(
object
):
"""Dummy request"""
"""Dummy request"""
...
...
lms/djangoapps/instructor/offline_gradecalc.py
View file @
cf930814
...
@@ -16,6 +16,7 @@ from django.contrib.auth.models import User
...
@@ -16,6 +16,7 @@ from django.contrib.auth.models import User
from
instructor.utils
import
DummyRequest
from
instructor.utils
import
DummyRequest
class
MyEncoder
(
JSONEncoder
):
class
MyEncoder
(
JSONEncoder
):
def
_iterencode
(
self
,
obj
,
markers
=
None
):
def
_iterencode
(
self
,
obj
,
markers
=
None
):
...
...
lms/djangoapps/instructor/views/legacy.py
View file @
cf930814
...
@@ -1431,6 +1431,7 @@ def get_student_grade_summary_data(request, course, get_grades=True, get_raw_sco
...
@@ -1431,6 +1431,7 @@ def get_student_grade_summary_data(request, course, get_grades=True, get_raw_sco
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# enrollment
# enrollment
def
_do_enroll_students
(
course
,
course_key
,
students
,
secure
=
False
,
overload
=
False
,
auto_enroll
=
False
,
email_students
=
False
,
is_shib_course
=
False
):
def
_do_enroll_students
(
course
,
course_key
,
students
,
secure
=
False
,
overload
=
False
,
auto_enroll
=
False
,
email_students
=
False
,
is_shib_course
=
False
):
"""
"""
Do the actual work of enrolling multiple students, presented as a string
Do the actual work of enrolling multiple students, presented as a string
...
...
lms/djangoapps/instructor_task/admin.py
View file @
cf930814
...
@@ -8,6 +8,7 @@ a task.
...
@@ -8,6 +8,7 @@ a task.
from
django.contrib
import
admin
from
django.contrib
import
admin
from
.models
import
InstructorTask
from
.models
import
InstructorTask
class
InstructorTaskAdmin
(
admin
.
ModelAdmin
):
class
InstructorTaskAdmin
(
admin
.
ModelAdmin
):
list_display
=
[
list_display
=
[
'task_id'
,
'task_id'
,
...
...
lms/djangoapps/notification_prefs/views.py
View file @
cf930814
...
@@ -132,6 +132,7 @@ def ajax_disable(request):
...
@@ -132,6 +132,7 @@ def ajax_disable(request):
return
HttpResponse
(
status
=
204
)
return
HttpResponse
(
status
=
204
)
@require_GET
@require_GET
def
ajax_status
(
request
):
def
ajax_status
(
request
):
"""
"""
...
...
lms/djangoapps/open_ended_grading/staff_grading_service.py
View file @
cf930814
...
@@ -278,6 +278,7 @@ def get_next(request, course_id):
...
@@ -278,6 +278,7 @@ def get_next(request, course_id):
return
HttpResponse
(
json
.
dumps
(
_get_next
(
course_key
,
grader_id
,
location
)),
return
HttpResponse
(
json
.
dumps
(
_get_next
(
course_key
,
grader_id
,
location
)),
mimetype
=
"application/json"
)
mimetype
=
"application/json"
)
def
get_problem_list
(
request
,
course_id
):
def
get_problem_list
(
request
,
course_id
):
"""
"""
Get all the problems for the given course id
Get all the problems for the given course id
...
...
lms/djangoapps/shoppingcart/exceptions.py
View file @
cf930814
...
@@ -4,6 +4,7 @@ Exceptions for the shoppingcart app
...
@@ -4,6 +4,7 @@ Exceptions for the shoppingcart app
# (Exception Class Names are sort of self-explanatory, so skipping docstring requirement)
# (Exception Class Names are sort of self-explanatory, so skipping docstring requirement)
# pylint: disable=C0111
# pylint: disable=C0111
class
PaymentException
(
Exception
):
class
PaymentException
(
Exception
):
pass
pass
...
...
lms/djangoapps/shoppingcart/processors/exceptions.py
View file @
cf930814
...
@@ -16,5 +16,6 @@ class CCProcessorDataException(CCProcessorException):
...
@@ -16,5 +16,6 @@ class CCProcessorDataException(CCProcessorException):
class
CCProcessorWrongAmountException
(
CCProcessorException
):
class
CCProcessorWrongAmountException
(
CCProcessorException
):
pass
pass
class
CCProcessorUserCancelled
(
CCProcessorException
):
class
CCProcessorUserCancelled
(
CCProcessorException
):
pass
pass
lms/djangoapps/shoppingcart/tests/test_models.py
View file @
cf930814
...
@@ -37,6 +37,7 @@ from opaque_keys.edx.locator import CourseLocator
...
@@ -37,6 +37,7 @@ from opaque_keys.edx.locator import CourseLocator
# that disables the XML modulestore.
# that disables the XML modulestore.
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
class
OrderTest
(
ModuleStoreTestCase
):
class
OrderTest
(
ModuleStoreTestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
lms/djangoapps/shoppingcart/views.py
View file @
cf930814
...
@@ -196,6 +196,7 @@ def remove_item(request):
...
@@ -196,6 +196,7 @@ def remove_item(request):
return
HttpResponse
(
'OK'
)
return
HttpResponse
(
'OK'
)
def
remove_code_redemption
(
order_item_course_id
,
item_id
,
item
,
user
):
def
remove_code_redemption
(
order_item_course_id
,
item_id
,
item
,
user
):
"""
"""
If an item removed from shopping cart then we will remove
If an item removed from shopping cart then we will remove
...
...
lms/djangoapps/staticbook/views.py
View file @
cf930814
...
@@ -130,6 +130,7 @@ def pdf_index(request, course_id, book_index, chapter=None, page=None):
...
@@ -130,6 +130,7 @@ def pdf_index(request, course_id, book_index, chapter=None, page=None):
},
},
)
)
@login_required
@login_required
def
html_index
(
request
,
course_id
,
book_index
,
chapter
=
None
):
def
html_index
(
request
,
course_id
,
book_index
,
chapter
=
None
):
"""
"""
...
...
lms/djangoapps/verify_student/tests/test_ssencrypt.py
View file @
cf930814
...
@@ -7,6 +7,7 @@ from verify_student.ssencrypt import (
...
@@ -7,6 +7,7 @@ from verify_student.ssencrypt import (
rsa_decrypt
,
rsa_encrypt
,
random_aes_key
rsa_decrypt
,
rsa_encrypt
,
random_aes_key
)
)
def
test_aes
():
def
test_aes
():
key_str
=
"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"
key_str
=
"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"
key
=
key_str
.
decode
(
"hex"
)
key
=
key_str
.
decode
(
"hex"
)
...
@@ -28,6 +29,7 @@ def test_aes():
...
@@ -28,6 +29,7 @@ def test_aes():
assert_roundtrip
(
""
)
assert_roundtrip
(
""
)
assert_roundtrip
(
"
\xe9\xe1
a
\x13\x1b
T5
\xc8
"
)
# Random, non-ASCII text
assert_roundtrip
(
"
\xe9\xe1
a
\x13\x1b
T5
\xc8
"
)
# Random, non-ASCII text
def
test_rsa
():
def
test_rsa
():
# Make up some garbage keys for testing purposes.
# Make up some garbage keys for testing purposes.
pub_key_str
=
"""-----BEGIN PUBLIC KEY-----
pub_key_str
=
"""-----BEGIN PUBLIC KEY-----
...
...
manage.py
View file @
cf930814
...
@@ -21,6 +21,7 @@ import importlib
...
@@ -21,6 +21,7 @@ import importlib
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
import
contracts
import
contracts
def
parse_args
():
def
parse_args
():
"""Parse edx specific arguments to manage.py"""
"""Parse edx specific arguments to manage.py"""
parser
=
ArgumentParser
()
parser
=
ArgumentParser
()
...
...
pavelib/acceptance_test.py
View file @
cf930814
...
@@ -12,6 +12,7 @@ except ImportError:
...
@@ -12,6 +12,7 @@ except ImportError:
__test__
=
False
# do not collect
__test__
=
False
# do not collect
@task
@task
@needs
(
@needs
(
'pavelib.prereqs.install_prereqs'
,
'pavelib.prereqs.install_prereqs'
,
...
...
pavelib/i18n.py
View file @
cf930814
...
@@ -168,6 +168,7 @@ def i18n_ltr():
...
@@ -168,6 +168,7 @@ def i18n_ltr():
sh
(
'git add conf/locale'
)
sh
(
'git add conf/locale'
)
sh
(
'git commit --amend'
)
sh
(
'git commit --amend'
)
@task
@task
@needs
(
@needs
(
"pavelib.i18n.i18n_transifex_pull"
,
"pavelib.i18n.i18n_transifex_pull"
,
...
...
pavelib/paver_tests/test_paver_quality.py
View file @
cf930814
...
@@ -8,6 +8,7 @@ import pavelib.quality
...
@@ -8,6 +8,7 @@ import pavelib.quality
import
paver.easy
import
paver.easy
from
paver.easy
import
BuildFailure
from
paver.easy
import
BuildFailure
@ddt
@ddt
class
TestPaverQualityViolations
(
unittest
.
TestCase
):
class
TestPaverQualityViolations
(
unittest
.
TestCase
):
...
...
pavelib/quality.py
View file @
cf930814
...
@@ -65,6 +65,7 @@ def run_pylint(options):
...
@@ -65,6 +65,7 @@ def run_pylint(options):
raise
Exception
(
"Failed. Too many pylint violations. "
raise
Exception
(
"Failed. Too many pylint violations. "
"The limit is {violations_limit}."
.
format
(
violations_limit
=
violations_limit
))
"The limit is {violations_limit}."
.
format
(
violations_limit
=
violations_limit
))
def
_count_pylint_violations
(
report_file
):
def
_count_pylint_violations
(
report_file
):
"""
"""
Parses a pylint report line-by-line and determines the number of violations reported
Parses a pylint report line-by-line and determines the number of violations reported
...
@@ -83,6 +84,7 @@ def _count_pylint_violations(report_file):
...
@@ -83,6 +84,7 @@ def _count_pylint_violations(report_file):
num_violations_report
+=
1
num_violations_report
+=
1
return
num_violations_report
return
num_violations_report
@task
@task
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@cmdopts
([
@cmdopts
([
...
@@ -113,10 +115,12 @@ def run_pep8(options):
...
@@ -113,10 +115,12 @@ def run_pep8(options):
raise
Exception
(
"Failed. Too many pep8 violations. "
raise
Exception
(
"Failed. Too many pep8 violations. "
"The limit is {violations_limit}."
.
format
(
violations_limit
=
violations_limit
))
"The limit is {violations_limit}."
.
format
(
violations_limit
=
violations_limit
))
def
_count_pep8_violations
(
report_file
):
def
_count_pep8_violations
(
report_file
):
num_lines
=
sum
(
1
for
line
in
open
(
report_file
))
num_lines
=
sum
(
1
for
line
in
open
(
report_file
))
return
num_lines
return
num_lines
@task
@task
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@cmdopts
([
@cmdopts
([
...
...
pavelib/utils/envs.py
View file @
cf930814
...
@@ -9,6 +9,7 @@ from lazy import lazy
...
@@ -9,6 +9,7 @@ from lazy import lazy
from
path
import
path
from
path
import
path
import
memcache
import
memcache
class
Env
(
object
):
class
Env
(
object
):
"""
"""
Load information about the execution environment.
Load information about the execution environment.
...
...
pavelib/utils/test/utils.py
View file @
cf930814
...
@@ -54,6 +54,7 @@ def clean_mongo():
...
@@ -54,6 +54,7 @@ def clean_mongo():
repo_root
=
Env
.
REPO_ROOT
,
repo_root
=
Env
.
REPO_ROOT
,
))
))
def
check_firefox_version
():
def
check_firefox_version
():
"""
"""
Check that firefox is the correct version.
Check that firefox is the correct version.
...
...
scripts/run_watch_data.py
View file @
cf930814
This diff is collapsed.
Click to expand it.
scripts/runone.py
View file @
cf930814
This diff is collapsed.
Click to expand it.
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