Make quoting consistent in the new tests

This commit is contained in:
Jason Grout 2015-03-27 15:02:50 +00:00
parent 50a0cd57ef
commit b7a0163810

View File

@ -183,29 +183,29 @@ casper.notebook_test(function () {
' try:', ' try:',
' y = memoryview(x)', ' y = memoryview(x)',
' except TypeError:', ' except TypeError:',
" # in python 2, arrays don't support the new buffer protocol", ' # in python 2, arrays do not support the new buffer protocol',
' y = memoryview(buffer(x))', ' y = memoryview(buffer(x))',
" return y, {'serialization': ('floatArray', 'TestWidget')}", ' return y, {"serialization": ("floatArray", "TestWidget")}',
'def _memoryview_to_array(x):', 'def _memoryview_to_array(x):',
" return array('d', x.tobytes())", ' return array("d", x.tobytes())',
'arrays_binary = {', 'arrays_binary = {',
" 'from_json': _memoryview_to_array,", ' "from_json": _memoryview_to_array,',
" 'to_json': _array_to_memoryview", ' "to_json": _array_to_memoryview',
'}', '}',
'', '',
'def _array_to_list(x):', 'def _array_to_list(x):',
' if x is None: return None, {}', ' if x is None: return None, {}',
" return list(x), {'serialization': ('floatList', 'TestWidget')}", ' return list(x), {"serialization": ("floatList", "TestWidget")}',
'def _list_to_array(x):', 'def _list_to_array(x):',
" return array('d',x)", ' return array("d",x)',
'arrays_list = {', 'arrays_list = {',
" 'from_json': _list_to_array,", ' "from_json": _list_to_array,',
" 'to_json': _array_to_list", ' "to_json": _array_to_list',
'}', '}',
'', '',
'class TestWidget(widgets.DOMWidget):', 'class TestWidget(widgets.DOMWidget):',
" _view_module = Unicode('TestWidget', sync=True)", ' _view_module = Unicode("TestWidget", sync=True)',
" _view_name = Unicode('TestWidget', sync=True)", ' _view_name = Unicode("TestWidget", sync=True)',
' array_binary = Instance(array, sync=True, **arrays_binary)', ' array_binary = Instance(array, sync=True, **arrays_binary)',
' array_list = Instance(array, sync=True, **arrays_list)', ' array_list = Instance(array, sync=True, **arrays_list)',
' msg = {}', ' msg = {}',