예제 #1
0
def test_compress_array_LZ4_sequential():
    use_lz4hc(False)
    cfn = Mock()
    with patch('arctic._compression.clz4.compress', cfn):
        compress_array(["foo"] * 49)
        assert cfn.call_count == 49
예제 #2
0
def test_compress_LZ4():
    use_lz4hc(False)
    cfn = Mock()
    with patch('arctic._compression.clz4.compress', cfn):
        compress("foo")
        assert cfn.call_count == 1
예제 #3
0
def test_compress_array_usesLZ4():
    use_lz4hc(False)
    cfn = Mock()
    with patch('arctic._compression.clz4.compressarr', cfn):
        compress_array(["foo"] * 100)
        assert cfn.call_count == 1
예제 #4
0
def test_use_lz4hc_True():
    use_lz4hc(True)
    assert _should_use_lz4hc() is True
예제 #5
0
def test_use_lz4hc_False():
    use_lz4hc(False)
    assert _should_use_lz4hc() is False
예제 #6
0
def test_compress_array_LZ4_sequential():
    use_lz4hc(False)
    cfn = Mock()
    with patch('arctic._compression.clz4.compress', cfn):
        compress_array(["foo"] * 49)
        assert cfn.call_count == 49
예제 #7
0
def test_use_lz4hc():
    use_lz4hc(True)
    assert _compression.USE_LZ4HC is True
    use_lz4hc(False)
    assert _compression.USE_LZ4HC is False
예제 #8
0
def test_compress_array_usesLZ4():
    use_lz4hc(False)
    cfn = Mock()
    with patch('arctic._compression.clz4.compressarr', cfn):
        compress_array(["foo"] * 100)
        assert cfn.call_count == 1
예제 #9
0
def test_compress_LZ4():
    use_lz4hc(False)
    cfn = Mock()
    with patch('arctic._compression.clz4.compress', cfn):
        compress("foo")
        assert cfn.call_count == 1
예제 #10
0
def test_use_lz4hc_False():
    use_lz4hc(False)
    assert _should_use_lz4hc() is False
예제 #11
0
def test_use_lz4hc_True():
    use_lz4hc(True)
    assert _should_use_lz4hc() is True
예제 #12
0
def test_use_lz4hc():
    use_lz4hc(True)
    assert _compression.USE_LZ4HC is True
    use_lz4hc(False)
    assert _compression.USE_LZ4HC is False