We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e8933d commit c257aeeCopy full SHA for c257aee
tests/test_igzip_threaded.py
@@ -25,6 +25,22 @@ def test_threaded_read():
25
assert thread_data == data
26
27
28
+def test_threaded_write():
29
+ with tempfile.NamedTemporaryFile("wb", delete=False) as tmp:
30
+ with igzip_threaded.open(tmp, "wb", threads=3) as out_file:
31
+ with gzip.open(TEST_FILE) as in_file:
32
+ while True:
33
+ block = in_file.read(128 * 1024)
34
+ if not block:
35
+ break
36
+ out_file.write(block)
37
+ with gzip.open(TEST_FILE, "rt") as test_file:
38
+ test_data = test_file.read()
39
+ with gzip.open(tmp.name, "rt") as test_out:
40
+ out_data = test_out.read()
41
+ assert test_data == out_data
42
+
43
44
# Test whether threaded readers and writers throw an error rather than hang
45
# indefinitely.
46
0 commit comments