示例#1
0
def test_byte_transport(server):
    conn = Client(**socket_options)
    s = 8
    r = conn(test=dict(test_byte_transport=(s, )))
    assert r['test']['test_byte_transport'] == s
示例#2
0
def test_str_transport(server):
    conn = Client(**socket_options)
    s = 'hello'
    r = conn(test=dict(test_str_transport=(s, )))
    assert r['test']['test_str_transport'] == s
示例#3
0
def test_ndarray_transport2(server):
    conn = Client(**socket_options)
    arr = np.array([1, 2, 3, 4], dtype=np.int64)
    r = conn(test=dict(test_ndarray_transport2=(arr, )))
    np.testing.assert_equal(r['test']['test_ndarray_transport2'], arr)
示例#4
0
def test_Data_transport2(server):
    conn = Client(**socket_options)
    data = dict(a=1, b=[1, 2, 3], c=dict(d=13.4))
    r = conn(test=dict(test_Data_transport2=(data, )))
    assert r['test']['test_Data_transport2'] == data
示例#5
0
def test_buffer_transport(server):
    conn = Client(**socket_options)
    arr = np.array([1, 2, 3, 4], dtype=np.int64)
    r = conn(test=dict(test_buffer_transport=(arr, )))
    np.testing.assert_equal(r['test']['test_buffer_transport'],
                            arr.view(np.uint8))