We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
zstd tests: are erroneously skipped
in master and 1.1.x, the zstd tests were skipped because a not anymore used zstd import.

borg initially used the "zstd" python binding, but later replaced this by an own Cython-based binding, so we do not have the zstd module installed any more - thus the tests checking for that were always skipped.

note: no impact on productive use of borg.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/borg/testsuite/compress.py`
Content:
```
1 import os
2 import zlib
3 try:
4     import lzma
5 except ImportError:
6     lzma = None
7 
8 try:
9     import zstd
10 except ImportError:
11     zstd = None
12 
13 import pytest
14 
15 from ..compress import get_compressor, Compressor, CompressionSpec, CNONE, ZLIB, LZ4, LZMA, ZSTD, Auto
16 
17 
18 buffer = bytes(2**16)
19 data = b'fooooooooobaaaaaaaar' * 10
20 params = dict(name='zlib', level=6)
21 
22 
23 def test_get_compressor():
24     c = get_compressor(name='none')
25     assert isinstance(c, CNONE)
26     c = get_compressor(name='lz4')
27     assert isinstance(c, LZ4)
28     c = get_compressor(name='zlib')
29     assert isinstance(c, ZLIB)
30     with pytest.raises(KeyError):
31         get_compressor(name='foobar')
32 
33 
34 def test_cnull():
35     c = get_compressor(name='none')
36     cdata = c.compress(data)
37     assert len(cdata) > len(data)
38     assert data in cdata  # it's not compressed and just in there 1:1
39     assert data == c.decompress(cdata)
40     assert data == Compressor(**params).decompress(cdata)  # autodetect
41 
42 
43 def test_lz4():
44     c = get_compressor(name='lz4')
45     cdata = c.compress(data)
46     assert len(cdata) < len(data)
47     assert data == c.decompress(cdata)
48     assert data == Compressor(**params).decompress(cdata)  # autodetect
49 
50 
51 def test_lz4_buffer_allocation():
52     # test with a rather huge data object to see if buffer allocation / resizing works
53     data = os.urandom(50 * 2**20)  # 50MiB incompressible data
54     c = get_compressor(name='lz4')
55     cdata = c.compress(data)
56     assert data == c.decompress(cdata)
57 
58 
59 def test_zlib():
60     c = get_compressor(name='zlib')
61     cdata = c.compress(data)
62     assert len(cdata) < len(data)
63     assert data == c.decompress(cdata)
64     assert data == Compressor(**params).decompress(cdata)  # autodetect
65 
66 
67 def test_lzma():
68     if lzma is None:
69         pytest.skip("No lzma support found.")
70     c = get_compressor(name='lzma')
71     cdata = c.compress(data)
72     assert len(cdata) < len(data)
73     assert data == c.decompress(cdata)
74     assert data == Compressor(**params).decompress(cdata)  # autodetect
75 
76 
77 def test_zstd():
78     if zstd is None:
79         pytest.skip("No zstd support found.")
80     c = get_compressor(name='zstd')
81     cdata = c.compress(data)
82     assert len(cdata) < len(data)
83     assert data == c.decompress(cdata)
84     assert data == Compressor(**params).decompress(cdata)  # autodetect
85 
86 
87 def test_autodetect_invalid():
88     with pytest.raises(ValueError):
89         Compressor(**params).decompress(b'\xff\xfftotalcrap')
90     with pytest.raises(ValueError):
91         Compressor(**params).decompress(b'\x08\x00notreallyzlib')
92 
93 
94 def test_zlib_compat():
95     # for compatibility reasons, we do not add an extra header for zlib,
96     # nor do we expect one when decompressing / autodetecting
97     for level in range(10):
98         c = get_compressor(name='zlib', level=level)
99         cdata1 = c.compress(data)
100         cdata2 = zlib.compress(data, level)
101         assert cdata1 == cdata2
102         data2 = c.decompress(cdata2)
103         assert data == data2
104         data2 = Compressor(**params).decompress(cdata2)
105         assert data == data2
106 
107 
108 def test_compressor():
109     params_list = [
110         dict(name='none'),
111         dict(name='lz4'),
112         dict(name='zlib', level=0),
113         dict(name='zlib', level=6),
114         dict(name='zlib', level=9),
115     ]
116     if lzma:
117         params_list += [
118             dict(name='lzma', level=0),
119             dict(name='lzma', level=6),
120             # we do not test lzma on level 9 because of the huge memory needs
121         ]
122     if zstd:
123         params_list += [
124             dict(name='zstd', level=1),
125             dict(name='zstd', level=3),
126             # also avoiding high zstd levels, memory needs unclear
127         ]
128     for params in params_list:
129         c = Compressor(**params)
130         assert data == c.decompress(c.compress(data))
131 
132 
133 def test_auto():
134     compressor_auto_zlib = CompressionSpec('auto,zlib,9').compressor
135     compressor_lz4 = CompressionSpec('lz4').compressor
136     compressor_zlib = CompressionSpec('zlib,9').compressor
137     data = bytes(500)
138     compressed_auto_zlib = compressor_auto_zlib.compress(data)
139     compressed_lz4 = compressor_lz4.compress(data)
140     compressed_zlib = compressor_zlib.compress(data)
141     ratio = len(compressed_zlib) / len(compressed_lz4)
142     assert Compressor.detect(compressed_auto_zlib) == ZLIB if ratio < 0.99 else LZ4
143 
144     data = b'\x00\xb8\xa3\xa2-O\xe1i\xb6\x12\x03\xc21\xf3\x8a\xf78\\\x01\xa5b\x07\x95\xbeE\xf8\xa3\x9ahm\xb1~'
145     compressed = compressor_auto_zlib.compress(data)
146     assert Compressor.detect(compressed) == CNONE
147 
148 
149 def test_compression_specs():
150     with pytest.raises(ValueError):
151         CompressionSpec('')
152 
153     assert isinstance(CompressionSpec('none').compressor, CNONE)
154     assert isinstance(CompressionSpec('lz4').compressor, LZ4)
155 
156     zlib = CompressionSpec('zlib').compressor
157     assert isinstance(zlib, ZLIB)
158     assert zlib.level == 6
159     zlib = CompressionSpec('zlib,0').compressor
160     assert isinstance(zlib, ZLIB)
161     assert zlib.level == 0
162     zlib = CompressionSpec('zlib,9').compressor
163     assert isinstance(zlib, ZLIB)
164     assert zlib.level == 9
165     with pytest.raises(ValueError):
166         CompressionSpec('zlib,9,invalid')
167 
168     lzma = CompressionSpec('lzma').compressor
169     assert isinstance(lzma, LZMA)
170     assert lzma.level == 6
171     lzma = CompressionSpec('lzma,0').compressor
172     assert isinstance(lzma, LZMA)
173     assert lzma.level == 0
174     lzma = CompressionSpec('lzma,9').compressor
175     assert isinstance(lzma, LZMA)
176     assert lzma.level == 9
177 
178     zstd = CompressionSpec('zstd').compressor
179     assert isinstance(zstd, ZSTD)
180     assert zstd.level == 3
181     zstd = CompressionSpec('zstd,1').compressor
182     assert isinstance(zstd, ZSTD)
183     assert zstd.level == 1
184     zstd = CompressionSpec('zstd,22').compressor
185     assert isinstance(zstd, ZSTD)
186     assert zstd.level == 22
187 
188     with pytest.raises(ValueError):
189         CompressionSpec('lzma,9,invalid')
190     with pytest.raises(ValueError):
191         CompressionSpec('invalid')
192
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/borg/testsuite/compress.py b/src/borg/testsuite/compress.py
--- a/src/borg/testsuite/compress.py
+++ b/src/borg/testsuite/compress.py
@@ -5,11 +5,6 @@
 except ImportError:
     lzma = None
 
-try:
-    import zstd
-except ImportError:
-    zstd = None
-
 import pytest
 
 from ..compress import get_compressor, Compressor, CompressionSpec, CNONE, ZLIB, LZ4, LZMA, ZSTD, Auto
@@ -75,8 +70,6 @@
 
 
 def test_zstd():
-    if zstd is None:
-        pytest.skip("No zstd support found.")
     c = get_compressor(name='zstd')
     cdata = c.compress(data)
     assert len(cdata) < len(data)
@@ -109,6 +102,9 @@
     params_list = [
         dict(name='none'),
         dict(name='lz4'),
+        dict(name='zstd', level=1),
+        dict(name='zstd', level=3),
+        # avoiding high zstd levels, memory needs unclear
         dict(name='zlib', level=0),
         dict(name='zlib', level=6),
         dict(name='zlib', level=9),
@@ -119,12 +115,6 @@
             dict(name='lzma', level=6),
             # we do not test lzma on level 9 because of the huge memory needs
         ]
-    if zstd:
-        params_list += [
-            dict(name='zstd', level=1),
-            dict(name='zstd', level=3),
-            # also avoiding high zstd levels, memory needs unclear
-        ]
     for params in params_list:
         c = Compressor(**params)
         assert data == c.decompress(c.compress(data))

{"golden_diff": "diff --git a/src/borg/testsuite/compress.py b/src/borg/testsuite/compress.py\n--- a/src/borg/testsuite/compress.py\n+++ b/src/borg/testsuite/compress.py\n@@ -5,11 +5,6 @@\n except ImportError:\n     lzma = None\n \n-try:\n-    import zstd\n-except ImportError:\n-    zstd = None\n-\n import pytest\n \n from ..compress import get_compressor, Compressor, CompressionSpec, CNONE, ZLIB, LZ4, LZMA, ZSTD, Auto\n@@ -75,8 +70,6 @@\n \n \n def test_zstd():\n-    if zstd is None:\n-        pytest.skip(\"No zstd support found.\")\n     c = get_compressor(name='zstd')\n     cdata = c.compress(data)\n     assert len(cdata) < len(data)\n@@ -109,6 +102,9 @@\n     params_list = [\n         dict(name='none'),\n         dict(name='lz4'),\n+        dict(name='zstd', level=1),\n+        dict(name='zstd', level=3),\n+        # avoiding high zstd levels, memory needs unclear\n         dict(name='zlib', level=0),\n         dict(name='zlib', level=6),\n         dict(name='zlib', level=9),\n@@ -119,12 +115,6 @@\n             dict(name='lzma', level=6),\n             # we do not test lzma on level 9 because of the huge memory needs\n         ]\n-    if zstd:\n-        params_list += [\n-            dict(name='zstd', level=1),\n-            dict(name='zstd', level=3),\n-            # also avoiding high zstd levels, memory needs unclear\n-        ]\n     for params in params_list:\n         c = Compressor(**params)\n         assert data == c.decompress(c.compress(data))\n", "issue": "zstd tests: are erroneously skipped\nin master and 1.1.x, the zstd tests were skipped because a not anymore used zstd import.\r\n\r\nborg initially used the \"zstd\" python binding, but later replaced this by an own Cython-based binding, so we do not have the zstd module installed any more - thus the tests checking for that were always skipped.\r\n\r\nnote: no impact on productive use of borg.\n", "before_files": [{"content": "import os\nimport zlib\ntry:\n    import lzma\nexcept ImportError:\n    lzma = None\n\ntry:\n    import zstd\nexcept ImportError:\n    zstd = None\n\nimport pytest\n\nfrom ..compress import get_compressor, Compressor, CompressionSpec, CNONE, ZLIB, LZ4, LZMA, ZSTD, Auto\n\n\nbuffer = bytes(2**16)\ndata = b'fooooooooobaaaaaaaar' * 10\nparams = dict(name='zlib', level=6)\n\n\ndef test_get_compressor():\n    c = get_compressor(name='none')\n    assert isinstance(c, CNONE)\n    c = get_compressor(name='lz4')\n    assert isinstance(c, LZ4)\n    c = get_compressor(name='zlib')\n    assert isinstance(c, ZLIB)\n    with pytest.raises(KeyError):\n        get_compressor(name='foobar')\n\n\ndef test_cnull():\n    c = get_compressor(name='none')\n    cdata = c.compress(data)\n    assert len(cdata) > len(data)\n    assert data in cdata  # it's not compressed and just in there 1:1\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_lz4():\n    c = get_compressor(name='lz4')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_lz4_buffer_allocation():\n    # test with a rather huge data object to see if buffer allocation / resizing works\n    data = os.urandom(50 * 2**20)  # 50MiB incompressible data\n    c = get_compressor(name='lz4')\n    cdata = c.compress(data)\n    assert data == c.decompress(cdata)\n\n\ndef test_zlib():\n    c = get_compressor(name='zlib')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_lzma():\n    if lzma is None:\n        pytest.skip(\"No lzma support found.\")\n    c = get_compressor(name='lzma')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_zstd():\n    if zstd is None:\n        pytest.skip(\"No zstd support found.\")\n    c = get_compressor(name='zstd')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_autodetect_invalid():\n    with pytest.raises(ValueError):\n        Compressor(**params).decompress(b'\\xff\\xfftotalcrap')\n    with pytest.raises(ValueError):\n        Compressor(**params).decompress(b'\\x08\\x00notreallyzlib')\n\n\ndef test_zlib_compat():\n    # for compatibility reasons, we do not add an extra header for zlib,\n    # nor do we expect one when decompressing / autodetecting\n    for level in range(10):\n        c = get_compressor(name='zlib', level=level)\n        cdata1 = c.compress(data)\n        cdata2 = zlib.compress(data, level)\n        assert cdata1 == cdata2\n        data2 = c.decompress(cdata2)\n        assert data == data2\n        data2 = Compressor(**params).decompress(cdata2)\n        assert data == data2\n\n\ndef test_compressor():\n    params_list = [\n        dict(name='none'),\n        dict(name='lz4'),\n        dict(name='zlib', level=0),\n        dict(name='zlib', level=6),\n        dict(name='zlib', level=9),\n    ]\n    if lzma:\n        params_list += [\n            dict(name='lzma', level=0),\n            dict(name='lzma', level=6),\n            # we do not test lzma on level 9 because of the huge memory needs\n        ]\n    if zstd:\n        params_list += [\n            dict(name='zstd', level=1),\n            dict(name='zstd', level=3),\n            # also avoiding high zstd levels, memory needs unclear\n        ]\n    for params in params_list:\n        c = Compressor(**params)\n        assert data == c.decompress(c.compress(data))\n\n\ndef test_auto():\n    compressor_auto_zlib = CompressionSpec('auto,zlib,9').compressor\n    compressor_lz4 = CompressionSpec('lz4').compressor\n    compressor_zlib = CompressionSpec('zlib,9').compressor\n    data = bytes(500)\n    compressed_auto_zlib = compressor_auto_zlib.compress(data)\n    compressed_lz4 = compressor_lz4.compress(data)\n    compressed_zlib = compressor_zlib.compress(data)\n    ratio = len(compressed_zlib) / len(compressed_lz4)\n    assert Compressor.detect(compressed_auto_zlib) == ZLIB if ratio < 0.99 else LZ4\n\n    data = b'\\x00\\xb8\\xa3\\xa2-O\\xe1i\\xb6\\x12\\x03\\xc21\\xf3\\x8a\\xf78\\\\\\x01\\xa5b\\x07\\x95\\xbeE\\xf8\\xa3\\x9ahm\\xb1~'\n    compressed = compressor_auto_zlib.compress(data)\n    assert Compressor.detect(compressed) == CNONE\n\n\ndef test_compression_specs():\n    with pytest.raises(ValueError):\n        CompressionSpec('')\n\n    assert isinstance(CompressionSpec('none').compressor, CNONE)\n    assert isinstance(CompressionSpec('lz4').compressor, LZ4)\n\n    zlib = CompressionSpec('zlib').compressor\n    assert isinstance(zlib, ZLIB)\n    assert zlib.level == 6\n    zlib = CompressionSpec('zlib,0').compressor\n    assert isinstance(zlib, ZLIB)\n    assert zlib.level == 0\n    zlib = CompressionSpec('zlib,9').compressor\n    assert isinstance(zlib, ZLIB)\n    assert zlib.level == 9\n    with pytest.raises(ValueError):\n        CompressionSpec('zlib,9,invalid')\n\n    lzma = CompressionSpec('lzma').compressor\n    assert isinstance(lzma, LZMA)\n    assert lzma.level == 6\n    lzma = CompressionSpec('lzma,0').compressor\n    assert isinstance(lzma, LZMA)\n    assert lzma.level == 0\n    lzma = CompressionSpec('lzma,9').compressor\n    assert isinstance(lzma, LZMA)\n    assert lzma.level == 9\n\n    zstd = CompressionSpec('zstd').compressor\n    assert isinstance(zstd, ZSTD)\n    assert zstd.level == 3\n    zstd = CompressionSpec('zstd,1').compressor\n    assert isinstance(zstd, ZSTD)\n    assert zstd.level == 1\n    zstd = CompressionSpec('zstd,22').compressor\n    assert isinstance(zstd, ZSTD)\n    assert zstd.level == 22\n\n    with pytest.raises(ValueError):\n        CompressionSpec('lzma,9,invalid')\n    with pytest.raises(ValueError):\n        CompressionSpec('invalid')\n", "path": "src/borg/testsuite/compress.py"}], "after_files": [{"content": "import os\nimport zlib\ntry:\n    import lzma\nexcept ImportError:\n    lzma = None\n\nimport pytest\n\nfrom ..compress import get_compressor, Compressor, CompressionSpec, CNONE, ZLIB, LZ4, LZMA, ZSTD, Auto\n\n\nbuffer = bytes(2**16)\ndata = b'fooooooooobaaaaaaaar' * 10\nparams = dict(name='zlib', level=6)\n\n\ndef test_get_compressor():\n    c = get_compressor(name='none')\n    assert isinstance(c, CNONE)\n    c = get_compressor(name='lz4')\n    assert isinstance(c, LZ4)\n    c = get_compressor(name='zlib')\n    assert isinstance(c, ZLIB)\n    with pytest.raises(KeyError):\n        get_compressor(name='foobar')\n\n\ndef test_cnull():\n    c = get_compressor(name='none')\n    cdata = c.compress(data)\n    assert len(cdata) > len(data)\n    assert data in cdata  # it's not compressed and just in there 1:1\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_lz4():\n    c = get_compressor(name='lz4')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_lz4_buffer_allocation():\n    # test with a rather huge data object to see if buffer allocation / resizing works\n    data = os.urandom(50 * 2**20)  # 50MiB incompressible data\n    c = get_compressor(name='lz4')\n    cdata = c.compress(data)\n    assert data == c.decompress(cdata)\n\n\ndef test_zlib():\n    c = get_compressor(name='zlib')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_lzma():\n    if lzma is None:\n        pytest.skip(\"No lzma support found.\")\n    c = get_compressor(name='lzma')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_zstd():\n    c = get_compressor(name='zstd')\n    cdata = c.compress(data)\n    assert len(cdata) < len(data)\n    assert data == c.decompress(cdata)\n    assert data == Compressor(**params).decompress(cdata)  # autodetect\n\n\ndef test_autodetect_invalid():\n    with pytest.raises(ValueError):\n        Compressor(**params).decompress(b'\\xff\\xfftotalcrap')\n    with pytest.raises(ValueError):\n        Compressor(**params).decompress(b'\\x08\\x00notreallyzlib')\n\n\ndef test_zlib_compat():\n    # for compatibility reasons, we do not add an extra header for zlib,\n    # nor do we expect one when decompressing / autodetecting\n    for level in range(10):\n        c = get_compressor(name='zlib', level=level)\n        cdata1 = c.compress(data)\n        cdata2 = zlib.compress(data, level)\n        assert cdata1 == cdata2\n        data2 = c.decompress(cdata2)\n        assert data == data2\n        data2 = Compressor(**params).decompress(cdata2)\n        assert data == data2\n\n\ndef test_compressor():\n    params_list = [\n        dict(name='none'),\n        dict(name='lz4'),\n        dict(name='zstd', level=1),\n        dict(name='zstd', level=3),\n        # avoiding high zstd levels, memory needs unclear\n        dict(name='zlib', level=0),\n        dict(name='zlib', level=6),\n        dict(name='zlib', level=9),\n    ]\n    if lzma:\n        params_list += [\n            dict(name='lzma', level=0),\n            dict(name='lzma', level=6),\n            # we do not test lzma on level 9 because of the huge memory needs\n        ]\n    for params in params_list:\n        c = Compressor(**params)\n        assert data == c.decompress(c.compress(data))\n\n\ndef test_auto():\n    compressor_auto_zlib = CompressionSpec('auto,zlib,9').compressor\n    compressor_lz4 = CompressionSpec('lz4').compressor\n    compressor_zlib = CompressionSpec('zlib,9').compressor\n    data = bytes(500)\n    compressed_auto_zlib = compressor_auto_zlib.compress(data)\n    compressed_lz4 = compressor_lz4.compress(data)\n    compressed_zlib = compressor_zlib.compress(data)\n    ratio = len(compressed_zlib) / len(compressed_lz4)\n    assert Compressor.detect(compressed_auto_zlib) == ZLIB if ratio < 0.99 else LZ4\n\n    data = b'\\x00\\xb8\\xa3\\xa2-O\\xe1i\\xb6\\x12\\x03\\xc21\\xf3\\x8a\\xf78\\\\\\x01\\xa5b\\x07\\x95\\xbeE\\xf8\\xa3\\x9ahm\\xb1~'\n    compressed = compressor_auto_zlib.compress(data)\n    assert Compressor.detect(compressed) == CNONE\n\n\ndef test_compression_specs():\n    with pytest.raises(ValueError):\n        CompressionSpec('')\n\n    assert isinstance(CompressionSpec('none').compressor, CNONE)\n    assert isinstance(CompressionSpec('lz4').compressor, LZ4)\n\n    zlib = CompressionSpec('zlib').compressor\n    assert isinstance(zlib, ZLIB)\n    assert zlib.level == 6\n    zlib = CompressionSpec('zlib,0').compressor\n    assert isinstance(zlib, ZLIB)\n    assert zlib.level == 0\n    zlib = CompressionSpec('zlib,9').compressor\n    assert isinstance(zlib, ZLIB)\n    assert zlib.level == 9\n    with pytest.raises(ValueError):\n        CompressionSpec('zlib,9,invalid')\n\n    lzma = CompressionSpec('lzma').compressor\n    assert isinstance(lzma, LZMA)\n    assert lzma.level == 6\n    lzma = CompressionSpec('lzma,0').compressor\n    assert isinstance(lzma, LZMA)\n    assert lzma.level == 0\n    lzma = CompressionSpec('lzma,9').compressor\n    assert isinstance(lzma, LZMA)\n    assert lzma.level == 9\n\n    zstd = CompressionSpec('zstd').compressor\n    assert isinstance(zstd, ZSTD)\n    assert zstd.level == 3\n    zstd = CompressionSpec('zstd,1').compressor\n    assert isinstance(zstd, ZSTD)\n    assert zstd.level == 1\n    zstd = CompressionSpec('zstd,22').compressor\n    assert isinstance(zstd, ZSTD)\n    assert zstd.level == 22\n\n    with pytest.raises(ValueError):\n        CompressionSpec('lzma,9,invalid')\n    with pytest.raises(ValueError):\n        CompressionSpec('invalid')\n", "path": "src/borg/testsuite/compress.py"}]}