def test_z_file(tmpdir):
    # Test saving and loading area_data with Zfiles.
    filename = tmpdir.join('test.pkl').strpath
    data = numpy_pickle_compat.asbytes('Foo, \n Bar, baz, \n\nfoobar')
    with open(filename, 'wb') as f:
        numpy_pickle_compat.write_zfile(f, data)
    with open(filename, 'rb') as f:
        data_read = numpy_pickle_compat.read_zfile(f)
    assert data == data_read
def test_z_file():
    # Test saving and loading data with Zfiles.
    filename = env["filename"] + str(random.randint(0, 1000))
    data = numpy_pickle_compat.asbytes("Foo, \n Bar, baz, \n\nfoobar")
    with open(filename, "wb") as f:
        numpy_pickle_compat.write_zfile(f, data)
    with open(filename, "rb") as f:
        data_read = numpy_pickle_compat.read_zfile(f)
    nose.tools.assert_equal(data, data_read)
Exemple #3
0
def test_z_file():
    # Test saving and loading data with Zfiles.
    filename = env['filename'] + str(random.randint(0, 1000))
    data = numpy_pickle_compat.asbytes('Foo, \n Bar, baz, \n\nfoobar')
    with open(filename, 'wb') as f:
        numpy_pickle_compat.write_zfile(f, data)
    with open(filename, 'rb') as f:
        data_read = numpy_pickle_compat.read_zfile(f)
    assert data == data_read
Exemple #4
0
def test_z_file():
    # Test saving and loading data with Zfiles.
    filename = env['filename'] + str(random.randint(0, 1000))
    data = numpy_pickle_compat.asbytes('Foo, \n Bar, baz, \n\nfoobar')
    with open(filename, 'wb') as f:
        numpy_pickle_compat.write_zfile(f, data)
    with open(filename, 'rb') as f:
        data_read = numpy_pickle_compat.read_zfile(f)
    assert data == data_read
def test_z_file(tmpdir):
    # Test saving and loading data with Zfiles.
    filename = tmpdir.join('test.pkl').strpath
    data = numpy_pickle_compat.asbytes('Foo, \n Bar, baz, \n\nfoobar')
    with open(filename, 'wb') as f:
        numpy_pickle_compat.write_zfile(f, data)
    with open(filename, 'rb') as f:
        data_read = numpy_pickle_compat.read_zfile(f)
    assert data == data_read