##// END OF EJS Templates
Path to glyphicon fonts (used by Bootstrap) was incorrect. Fixed paths to coincide with where the appropriate Bootstrap resources are when IPython-components is attached. Useful for those using Bootstrap classes in custom themes.
Path to glyphicon fonts (used by Bootstrap) was incorrect. Fixed paths to coincide with where the appropriate Bootstrap resources are when IPython-components is attached. Useful for those using Bootstrap classes in custom themes.

File last commit:

r20454:f1398d6c
r21063:0f77975f
Show More
test_serialize.py
26 lines | 764 B | text/x-python | PythonLexer
"""Test serialize/deserialize messages with buffers"""
import os
import nose.tools as nt
from IPython.kernel.zmq.session import Session
from ..base.zmqhandlers import (
serialize_binary_message,
deserialize_binary_message,
)
def test_serialize_binary():
s = Session()
msg = s.msg('data_pub', content={'a': 'b'})
msg['buffers'] = [ memoryview(os.urandom(3)) for i in range(3) ]
bmsg = serialize_binary_message(msg)
nt.assert_is_instance(bmsg, bytes)
def test_deserialize_binary():
s = Session()
msg = s.msg('data_pub', content={'a': 'b'})
msg['buffers'] = [ memoryview(os.urandom(2)) for i in range(3) ]
bmsg = serialize_binary_message(msg)
msg2 = deserialize_binary_message(bmsg)
nt.assert_equal(msg2, msg)