Exemplo n.º 1
0
def test_read_after_close(get_fn):
    f = NetCDFTrajectoryFile(get_fn('mdcrd.nc'))
    assert eq(f.n_atoms, 223)
    assert eq(f.n_frames, 101)

    f.close()

    # should be an IOError if you read a file that's closed
    with pytest.raises(IOError):
        f.read()
Exemplo n.º 2
0
def test_read_after_close():
    f = NetCDFTrajectoryFile(get_fn('mdcrd.nc'))
    yield lambda: eq(f.n_atoms, 223)
    yield lambda: eq(f.n_frames, 101)

    f.close()

    # should be an ioerror if you read a file that's closed
    assert_raises(IOError, lambda: f.read())
Exemplo n.º 3
0
def test_read_after_close():
    f = NetCDFTrajectoryFile(get_fn('mdcrd.nc'))
    yield lambda: eq(f.n_atoms, 223)
    yield lambda: eq(f.n_frames, 101)

    f.close()

    # should be an ioerror if you read a file that's closed
    assert_raises(IOError, lambda: f.read())