File: test_frame_8.py

package info (click to toggle)
python-lz4 4.4.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 568 kB
  • sloc: ansic: 3,101; python: 2,711; makefile: 150
file content (14 lines) | stat: -rw-r--r-- 457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import threading
import lz4.frame as lz4frame


def test_lz4frame_open_write_read_text_iter(tmp_path):
    data = u'This is a test string'
    thread_id = threading.get_native_id()
    with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='wt') as fp:
        fp.write(data)
    data_out = ''
    with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='rt') as fp:
        for line in fp:
            data_out += line
    assert data_out == data