Commit e7f8c7c6 by Will Daly

pep8 fixes

parent 39aa25c2
...@@ -7,6 +7,7 @@ import time ...@@ -7,6 +7,7 @@ import time
from logging import getLogger from logging import getLogger
logger = getLogger(__name__) logger = getLogger(__name__)
class MockXQueueRequestHandler(BaseHTTPRequestHandler): class MockXQueueRequestHandler(BaseHTTPRequestHandler):
''' '''
A handler for XQueue POST requests. A handler for XQueue POST requests.
...@@ -167,7 +168,7 @@ class MockXQueueServer(HTTPServer): ...@@ -167,7 +168,7 @@ class MockXQueueServer(HTTPServer):
''' '''
def __init__(self, port_num, def __init__(self, port_num,
grade_response_dict={'correct':True, 'score': 1, 'msg': ''}): grade_response_dict={'correct': True, 'score': 1, 'msg': ''}):
''' '''
Initialize the mock XQueue server instance. Initialize the mock XQueue server instance.
...@@ -273,6 +274,6 @@ class MockXQueueServerTest(unittest.TestCase): ...@@ -273,6 +274,6 @@ class MockXQueueServerTest(unittest.TestCase):
xqueue_body = json.dumps({'correct': True, 'score': 1, xqueue_body = json.dumps({'correct': True, 'score': 1,
'msg': '<div></div>'}) 'msg': '<div></div>'})
expected_callback_dict = {'xqueue_header': grade_header, expected_callback_dict = {'xqueue_header': grade_header,
'xqueue_body': xqueue_body } 'xqueue_body': xqueue_body}
MockXQueueRequestHandler.post_to_url.assert_called_with(callback_url, MockXQueueRequestHandler.post_to_url.assert_called_with(callback_url,
expected_callback_dict) expected_callback_dict)
...@@ -80,7 +80,7 @@ PROBLEM_FACTORY_DICT = { ...@@ -80,7 +80,7 @@ PROBLEM_FACTORY_DICT = {
a1=0 a1=0
a2=0 a2=0
return (a1+a2)==int(expect) return (a1+a2)==int(expect)
""") }}, """)}},
'code': { 'code': {
'factory': CodeResponseXMLFactory(), 'factory': CodeResponseXMLFactory(),
'kwargs': { 'kwargs': {
...@@ -124,6 +124,7 @@ def view_problem(step, problem_type): ...@@ -124,6 +124,7 @@ def view_problem(step, problem_type):
world.browser.visit(url) world.browser.visit(url)
@step(u'External graders respond "([^"]*)"') @step(u'External graders respond "([^"]*)"')
def set_external_grader_response(step, correctness): def set_external_grader_response(step, correctness):
assert(correctness in ['correct', 'incorrect']) assert(correctness in ['correct', 'incorrect'])
......
...@@ -3,6 +3,7 @@ from lettuce import before, after, world ...@@ -3,6 +3,7 @@ from lettuce import before, after, world
from django.conf import settings from django.conf import settings
import threading import threading
@before.all @before.all
def setup_mock_xqueue_server(): def setup_mock_xqueue_server():
...@@ -24,6 +25,7 @@ def setup_mock_xqueue_server(): ...@@ -24,6 +25,7 @@ def setup_mock_xqueue_server():
# (and we can shut it down later) # (and we can shut it down later)
world.xqueue_server = server world.xqueue_server = server
@after.all @after.all
def teardown_mock_xqueue_server(total): def teardown_mock_xqueue_server(total):
......
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