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
badd3a8d
Commit
badd3a8d
authored
May 23, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly stub out the controller_qs variable in the tested module. Test times out without this.
parent
aae3380a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
common/lib/xmodule/xmodule/open_ended_grading_classes/controller_query_service.py
+6
-6
lms/djangoapps/open_ended_grading/tests.py
+3
-4
lms/djangoapps/open_ended_grading/views.py
+1
-0
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/controller_query_service.py
View file @
badd3a8d
...
...
@@ -85,7 +85,7 @@ class MockControllerQueryService(object):
def
__init__
(
self
,
config
,
system
):
pass
def
check_if_name_is_unique
(
self
,
*
*
param
s
):
def
check_if_name_is_unique
(
self
,
*
args
,
**
kwarg
s
):
"""
Mock later if needed. Stub function for now.
@param params:
...
...
@@ -93,7 +93,7 @@ class MockControllerQueryService(object):
"""
pass
def
check_for_eta
(
self
,
*
*
param
s
):
def
check_for_eta
(
self
,
*
args
,
**
kwarg
s
):
"""
Mock later if needed. Stub function for now.
@param params:
...
...
@@ -101,19 +101,19 @@ class MockControllerQueryService(object):
"""
pass
def
check_combined_notifications
(
self
,
*
*
param
s
):
def
check_combined_notifications
(
self
,
*
args
,
**
kwarg
s
):
combined_notifications
=
'{"flagged_submissions_exist": false, "version": 1, "new_student_grading_to_view": false, "success": true, "staff_needs_to_grade": false, "student_needs_to_peer_grade": true, "overall_need_to_check": true}'
return
combined_notifications
def
get_grading_status_list
(
self
,
*
*
param
s
):
def
get_grading_status_list
(
self
,
*
args
,
**
kwarg
s
):
grading_status_list
=
'{"version": 1, "problem_list": [{"problem_name": "Science Question -- Machine Assessed", "grader_type": "NA", "eta_available": true, "state": "Waiting to be Graded", "eta": 259200, "location": "i4x://MITx/oe101x/combinedopenended/Science_SA_ML"}, {"problem_name": "Humanities Question -- Peer Assessed", "grader_type": "NA", "eta_available": true, "state": "Waiting to be Graded", "eta": 259200, "location": "i4x://MITx/oe101x/combinedopenended/Humanities_SA_Peer"}], "success": true}'
return
grading_status_list
def
get_flagged_problem_list
(
self
,
*
*
param
s
):
def
get_flagged_problem_list
(
self
,
*
args
,
**
kwarg
s
):
flagged_problem_list
=
'{"version": 1, "success": false, "error": "No flagged submissions exist for course: MITx/oe101x/2012_Fall"}'
return
flagged_problem_list
def
take_action_on_flags
(
self
,
*
*
param
s
):
def
take_action_on_flags
(
self
,
*
args
,
**
kwarg
s
):
"""
Mock later if needed. Stub function for now.
@param params:
...
...
lms/djangoapps/open_ended_grading/tests.py
View file @
badd3a8d
...
...
@@ -10,6 +10,7 @@ from mock import MagicMock, patch, Mock
from
django.core.urlresolvers
import
reverse
from
django.contrib.auth.models
import
Group
from
django.http
import
HttpResponse
from
django.conf
import
settings
from
mitxmako.shortcuts
import
render_to_string
from
xmodule.open_ended_grading_classes
import
peer_grading_service
,
controller_query_service
...
...
@@ -31,7 +32,6 @@ from xmodule.tests import test_util_open_ended
from
courseware.tests
import
factories
@override_settings
(
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
)
class
TestStaffGradingService
(
LoginEnrollmentTestCase
):
'''
...
...
@@ -310,8 +310,7 @@ class TestPanel(LoginEnrollmentTestCase):
found_module
,
peer_grading_module
=
views
.
find_peer_grading_module
(
self
.
course
)
self
.
assertTrue
(
found_module
)
@patch
(
'xmodule.open_ended_grading_classes.controller_query_service.ControllerQueryService'
,
controller_query_service
.
MockControllerQueryService
)
@patch
(
'open_ended_grading.views.controller_qs'
,
controller_query_service
.
MockControllerQueryService
(
settings
.
OPEN_ENDED_GRADING_INTERFACE
,
views
.
system
))
def
test_problem_list
(
self
):
"""
Ensure that the problem list from the grading controller server can be rendered properly locally
...
...
@@ -319,4 +318,4 @@ class TestPanel(LoginEnrollmentTestCase):
"""
request
=
Mock
(
user
=
self
.
user
)
response
=
views
.
student_problem_list
(
request
,
self
.
course
.
id
)
self
.
assert
True
(
isinstance
(
response
,
HttpResponse
)
)
self
.
assert
RegexpMatches
(
response
.
content
,
"Here are a list of open ended problems for this course."
)
lms/djangoapps/open_ended_grading/views.py
View file @
badd3a8d
...
...
@@ -36,6 +36,7 @@ system = ModuleSystem(
replace_urls
=
None
,
xblock_model_data
=
{}
)
controller_qs
=
ControllerQueryService
(
settings
.
OPEN_ENDED_GRADING_INTERFACE
,
system
)
"""
...
...
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