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
1b03534b
Commit
1b03534b
authored
Oct 06, 2014
by
Daniel Friedman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `upload_*_to_s3` to no longer reference s3
TNL-534
parent
af3d2713
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
lms/djangoapps/instructor_task/tasks.py
+4
-4
lms/djangoapps/instructor_task/tasks_helper.py
+2
-2
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
+4
-4
No files found.
lms/djangoapps/instructor_task/tasks.py
View file @
1b03534b
...
...
@@ -30,8 +30,8 @@ from instructor_task.tasks_helper import (
rescore_problem_module_state
,
reset_attempts_module_state
,
delete_problem_module_state
,
push_grades_to_s3
,
push_students_csv_to_s3
upload_grades_csv
,
upload_students_csv
)
from
bulk_email.tasks
import
perform_delegate_email_batches
...
...
@@ -139,7 +139,7 @@ def calculate_grades_csv(entry_id, xmodule_instance_args):
"""
# Translators: This is a past-tense verb that is inserted into task progress messages as {action}.
action_name
=
ugettext_noop
(
'graded'
)
task_fn
=
partial
(
push_grades_to_s3
,
xmodule_instance_args
)
task_fn
=
partial
(
upload_grades_csv
,
xmodule_instance_args
)
return
run_main_task
(
entry_id
,
task_fn
,
action_name
)
...
...
@@ -151,5 +151,5 @@ def calculate_students_features_csv(entry_id, xmodule_instance_args):
"""
# Translators: This is a past-tense verb that is inserted into task progress messages as {action}.
action_name
=
ugettext_noop
(
'generated'
)
task_fn
=
partial
(
push_students_csv_to_s3
,
xmodule_instance_args
)
task_fn
=
partial
(
upload_students_csv
,
xmodule_instance_args
)
return
run_main_task
(
entry_id
,
task_fn
,
action_name
)
lms/djangoapps/instructor_task/tasks_helper.py
View file @
1b03534b
...
...
@@ -505,7 +505,7 @@ def upload_csv_to_report_store(rows, csv_name, course_id, timestamp):
)
def
push_grades_to_s3
(
_xmodule_instance_args
,
_entry_id
,
course_id
,
_task_input
,
action_name
):
def
upload_grades_csv
(
_xmodule_instance_args
,
_entry_id
,
course_id
,
_task_input
,
action_name
):
"""
For a given `course_id`, generate a grades CSV file for all students that
are enrolled, and store using a `ReportStore`. Once created, the files can
...
...
@@ -596,7 +596,7 @@ def push_grades_to_s3(_xmodule_instance_args, _entry_id, course_id, _task_input,
return
update_task_progress
()
def
push_students_csv_to_s3
(
_xmodule_instance_args
,
_entry_id
,
course_id
,
task_input
,
_action_name
):
def
upload_students_csv
(
_xmodule_instance_args
,
_entry_id
,
course_id
,
task_input
,
_action_name
):
"""
For a given `course_id`, generate a CSV file containing profile
information for all students that are enrolled, and store using a
...
...
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
View file @
1b03534b
...
...
@@ -19,7 +19,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
from
instructor_task.models
import
ReportStore
from
instructor_task.tasks_helper
import
push_grades_to_s3
,
push_students_csv_to_s3
,
UPDATE_STATUS_SUCCEEDED
from
instructor_task.tasks_helper
import
upload_grades_csv
,
upload_students_csv
,
UPDATE_STATUS_SUCCEEDED
class
TestReport
(
ModuleStoreTestCase
):
...
...
@@ -55,7 +55,7 @@ class TestInstructorGradeReport(TestReport):
self
.
current_task
.
update_state
=
Mock
()
with
patch
(
'instructor_task.tasks_helper._get_current_task'
)
as
mock_current_task
:
mock_current_task
.
return_value
=
self
.
current_task
result
=
push_grades_to_s3
(
None
,
None
,
self
.
course
.
id
,
None
,
'graded'
)
result
=
upload_grades_csv
(
None
,
None
,
self
.
course
.
id
,
None
,
'graded'
)
#This assertion simply confirms that the generation completed with no errors
self
.
assertEquals
(
result
[
'succeeded'
],
result
[
'attempted'
])
...
...
@@ -68,7 +68,7 @@ class TestStudentReport(TestReport):
def
test_success
(
self
):
task_input
=
{
'features'
:
[]}
with
patch
(
'instructor_task.tasks_helper._get_current_task'
):
result
=
push_students_csv_to_s3
(
None
,
None
,
self
.
course
.
id
,
task_input
,
'calculated'
)
result
=
upload_students_csv
(
None
,
None
,
self
.
course
.
id
,
task_input
,
'calculated'
)
report_store
=
ReportStore
.
from_config
()
links
=
report_store
.
links_for
(
self
.
course
.
id
)
...
...
@@ -95,6 +95,6 @@ class TestStudentReport(TestReport):
}
with
patch
(
'instructor_task.tasks_helper._get_current_task'
)
as
mock_current_task
:
mock_current_task
.
return_value
=
self
.
current_task
result
=
push_students_csv_to_s3
(
None
,
None
,
self
.
course
.
id
,
task_input
,
'calculated'
)
result
=
upload_students_csv
(
None
,
None
,
self
.
course
.
id
,
task_input
,
'calculated'
)
#This assertion simply confirms that the generation completed with no errors
self
.
assertEquals
(
result
,
UPDATE_STATUS_SUCCEEDED
)
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