Commit 1b03534b by Daniel Friedman

Rename `upload_*_to_s3` to no longer reference s3

TNL-534
parent af3d2713
...@@ -30,8 +30,8 @@ from instructor_task.tasks_helper import ( ...@@ -30,8 +30,8 @@ from instructor_task.tasks_helper import (
rescore_problem_module_state, rescore_problem_module_state,
reset_attempts_module_state, reset_attempts_module_state,
delete_problem_module_state, delete_problem_module_state,
push_grades_to_s3, upload_grades_csv,
push_students_csv_to_s3 upload_students_csv
) )
from bulk_email.tasks import perform_delegate_email_batches from bulk_email.tasks import perform_delegate_email_batches
...@@ -139,7 +139,7 @@ def calculate_grades_csv(entry_id, xmodule_instance_args): ...@@ -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}. # Translators: This is a past-tense verb that is inserted into task progress messages as {action}.
action_name = ugettext_noop('graded') 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) return run_main_task(entry_id, task_fn, action_name)
...@@ -151,5 +151,5 @@ def calculate_students_features_csv(entry_id, xmodule_instance_args): ...@@ -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}. # Translators: This is a past-tense verb that is inserted into task progress messages as {action}.
action_name = ugettext_noop('generated') 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) 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): ...@@ -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 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 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, ...@@ -596,7 +596,7 @@ def push_grades_to_s3(_xmodule_instance_args, _entry_id, course_id, _task_input,
return update_task_progress() 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 For a given `course_id`, generate a CSV file containing profile
information for all students that are enrolled, and store using a information for all students that are enrolled, and store using a
......
...@@ -19,7 +19,7 @@ from xmodule.modulestore.tests.factories import CourseFactory ...@@ -19,7 +19,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from student.tests.factories import CourseEnrollmentFactory, UserFactory from student.tests.factories import CourseEnrollmentFactory, UserFactory
from instructor_task.models import ReportStore 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): class TestReport(ModuleStoreTestCase):
...@@ -55,7 +55,7 @@ class TestInstructorGradeReport(TestReport): ...@@ -55,7 +55,7 @@ class TestInstructorGradeReport(TestReport):
self.current_task.update_state = Mock() self.current_task.update_state = Mock()
with patch('instructor_task.tasks_helper._get_current_task') as mock_current_task: with patch('instructor_task.tasks_helper._get_current_task') as mock_current_task:
mock_current_task.return_value = self.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 #This assertion simply confirms that the generation completed with no errors
self.assertEquals(result['succeeded'], result['attempted']) self.assertEquals(result['succeeded'], result['attempted'])
...@@ -68,7 +68,7 @@ class TestStudentReport(TestReport): ...@@ -68,7 +68,7 @@ class TestStudentReport(TestReport):
def test_success(self): def test_success(self):
task_input = {'features': []} task_input = {'features': []}
with patch('instructor_task.tasks_helper._get_current_task'): 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() report_store = ReportStore.from_config()
links = report_store.links_for(self.course.id) links = report_store.links_for(self.course.id)
...@@ -95,6 +95,6 @@ class TestStudentReport(TestReport): ...@@ -95,6 +95,6 @@ class TestStudentReport(TestReport):
} }
with patch('instructor_task.tasks_helper._get_current_task') as mock_current_task: with patch('instructor_task.tasks_helper._get_current_task') as mock_current_task:
mock_current_task.return_value = self.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 #This assertion simply confirms that the generation completed with no errors
self.assertEquals(result, UPDATE_STATUS_SUCCEEDED) self.assertEquals(result, UPDATE_STATUS_SUCCEEDED)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment