def test_head_tail(): fs = MemoryFileSystem() with fs.open("/myfile", "wb") as f: f.write(b"I had a nice big cabbage") assert fs.head("/myfile", 5) == b"I had" assert fs.tail("/myfile", 7) == b"cabbage"
def test_head_tail(): fs = MemoryFileSystem() with fs.open('/myfile', 'wb') as f: f.write(b'I had a nice big cabbage') assert fs.head('/myfile', 5) == b'I had' assert fs.tail('/myfile', 7) == b'cabbage'