def test_raises_if_bad_tag():
    """Check that assertions are raised if compressed data isn't tagged."""
    scheme = ZlibPlcdScheme('x_v1', '')
    with pytest.raises(ValueError):
        scheme.decompress('')
def test_compress_and_decompress():
    """Test that decompress(compress(x)) == x."""
    scheme = ZlibPlcdScheme('hi', 'fandangle')
    for input_str in ('catfood', 'fandangle2'):
        compressed = scheme.compress(input_str)
        assert scheme.decompress(compressed) == input_str