示例#1
0
    def create_task(self):
        self.task = self.task_class(
            output_root='/fake/output',
            auth_user_path='/fake/input1',
            auth_userprofile_path='/fake/input2',
            explicit_event_whitelist='explicit_events.tsv',
        )
        explicit_event_list = """
            admin browser edx.instructor.report.downloaded
            admin server add-forum-admin

            admin server add-forum-community-TA
            admin server add-forum-mod
            admin server add-instructor
            admin server list-staff
            enrollment server edx.course.enrollment.activated
            # problem server problem_rescore
        """
        results = {
            'explicit_events': FakeTarget(value=self.reformat(explicit_event_list)),
        }
        self.task.input_local = MagicMock(return_value=results)
        self.task.init_local()
        self.task.geoip = FakeGeoLocation()

        self.task.user_info_requirements = get_mock_user_info_requirements()
    def setUp(self):
        self.task_class = LastCountryOfUser
        super(LastCountryOfUserReducerTestCase, self).setUp()

        self.username = "******"
        self.timestamp = "2013-12-17T15:38:32.805444"
        self.earlier_timestamp = "2013-12-15T15:38:32.805444"
        self.task.geoip = FakeGeoLocation()
        self.reduce_key = self.username