def test_cache_options():
    fs = DummyTestFS()
    f = AbstractBufferedFile(fs, 'misc/foo.txt', cache_type='bytes')
    assert f.cache.trim
    f = AbstractBufferedFile(fs, 'misc/foo.txt', cache_type='bytes', cache_options=dict(trim=False))
    assert (f.cache.trim is False)
    f = fs.open('misc/foo.txt', cache_type='bytes', cache_options=dict(trim=False))
    assert (f.cache.trim is False)
def test_cache_options():
    fs = DummyTestFS()
    f = AbstractBufferedFile(fs, 'misc/foo.txt', cache_type='bytes')
    assert f.cache.trim
    f = AbstractBufferedFile(fs, 'misc/foo.txt', cache_type='bytes', cache_options=dict(trim=False))
    assert (f.cache.trim is False)
    f = fs.open('misc/foo.txt', cache_type='bytes', cache_options=dict(trim=False))
    assert (f.cache.trim is False)