Rename upload_*_to_s3 to no longer reference s3
TNL-534
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user