Esempio n. 1
0
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"
Esempio n. 2
0
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'