From 1b03534b558f5a4795b4511e472a9cdcd38d8048 Mon Sep 17 00:00:00 2001 From: Daniel Friedman Date: Mon, 6 Oct 2014 13:25:56 -0400 Subject: [PATCH] Rename `upload_*_to_s3` to no longer reference s3 TNL-534 --- lms/djangoapps/instructor_task/tasks.py | 8 ++++---- lms/djangoapps/instructor_task/tasks_helper.py | 4 ++-- lms/djangoapps/instructor_task/tests/test_tasks_helper.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lms/djangoapps/instructor_task/tasks.py b/lms/djangoapps/instructor_task/tasks.py index 297c306637..7e62ba929a 100644 --- a/lms/djangoapps/instructor_task/tasks.py +++ b/lms/djangoapps/instructor_task/tasks.py @@ -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) diff --git a/lms/djangoapps/instructor_task/tasks_helper.py b/lms/djangoapps/instructor_task/tasks_helper.py index 9b7bfcae06..a60f955176 100644 --- a/lms/djangoapps/instructor_task/tasks_helper.py +++ b/lms/djangoapps/instructor_task/tasks_helper.py @@ -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 diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py index 77bb9825cc..b7e63ed195 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py @@ -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)