def test_mmap():
    for test, expectation in tests:
        f = tempfile.NamedTemporaryFile()
        f.write(test)
        f.flush()
        test_mmap = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
        assert buf_filled_with(test_mmap, test_mmap[0]) == expectation
Beispiel #2
0
def test_mmap():
    for test, expectation in tests:
        f = tempfile.NamedTemporaryFile()
        f.write(test)
        f.flush()
        test_mmap = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
        assert buf_filled_with(test_mmap, test_mmap[0]) == expectation
def test_str():
    for test, expectation in tests:
        assert buf_filled_with(test, test[0]) == expectation
def test_str():
    for test, expectation in tests:
        assert buf_filled_with(test, test[0]) == expectation