Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96e4bd0
commit a44ef05
Showing
4 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from hypothesis import given, settings, strategies as st | ||
|
||
from py_snappy import compress, decompress | ||
from snappy import compress as libsnappy_compress, decompress as libsnappy_decompress | ||
|
||
MEGABYTE = 1000000 | ||
|
||
|
||
@given(value=st.binary(min_size=1, max_size=2 * MEGABYTE)) | ||
@settings(max_examples=1000) | ||
def test_local_decompress_libsnappy_compressed(value): | ||
intermediate = libsnappy_compress(value) | ||
result = decompress(intermediate) | ||
assert value == result | ||
|
||
|
||
@given(value=st.binary(min_size=1, max_size=2 * MEGABYTE)) | ||
@settings(max_examples=1000) | ||
def test_libsnappy_decompress_local_compressed(value): | ||
intermediate = compress(value) | ||
result = libsnappy_decompress(intermediate) | ||
assert value == result |