aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gmail.com>2022-12-24 13:14:53 -0800
committerArthur Zamarin <arthurzam@gentoo.org>2022-12-25 19:49:11 +0200
commitd6a7c2e44b4f497357f8569d423104232a58f384 (patch)
tree625ac52169356714a9f5e69e11f2b6cc2d72355a /tests/compression/test_xz.py
parentcompression: prefer gtar over tar if available (diff)
downloadsnakeoil-d6a7c2e44b4f497357f8569d423104232a58f384.tar.gz
snakeoil-d6a7c2e44b4f497357f8569d423104232a58f384.tar.bz2
snakeoil-d6a7c2e44b4f497357f8569d423104232a58f384.zip
Reformat w/ black 22.12.0 for consistency.
Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests/compression/test_xz.py')
-rw-r--r--tests/compression/test_xz.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/tests/compression/test_xz.py b/tests/compression/test_xz.py
index f8417b3..0af7c64 100644
--- a/tests/compression/test_xz.py
+++ b/tests/compression/test_xz.py
@@ -10,26 +10,26 @@ from . import Base, hide_binary
def test_no_native():
- with hide_imports('lzma'):
+ with hide_imports("lzma"):
importlib.reload(_xz)
assert not _xz.native
def test_missing_xz_binary():
- with hide_binary('xz'):
- with pytest.raises(CommandNotFound, match='xz'):
+ with hide_binary("xz"):
+ with pytest.raises(CommandNotFound, match="xz"):
importlib.reload(_xz)
class XzBase(Base):
- module = 'xz'
- decompressed_test_data = b'Some text here\n' * 2
+ module = "xz"
+ decompressed_test_data = b"Some text here\n" * 2
compressed_test_data = (
- b'\xfd7zXZ\x00\x00\x04\xe6\xd6\xb4F\x04\xc0\x1e\x1e!\x01\x16\x00\x00\x00'
- b'\x00\x00\x00\x00\x00\x00j\xf6\x947\xe0\x00\x1d\x00\x16]\x00)\x9b\xc9\xa6g'
- b'Bw\x8c\xb3\x9eA\x9a\xbeT\xc9\xfa\xe3\x19\x8f(\x00\x00\x00\x00\x00\x96N'
- b'\xa8\x8ed\xa2WH\x00\x01:\x1e1V \xff\x1f\xb6\xf3}\x01\x00\x00\x00\x00\x04YZ'
+ b"\xfd7zXZ\x00\x00\x04\xe6\xd6\xb4F\x04\xc0\x1e\x1e!\x01\x16\x00\x00\x00"
+ b"\x00\x00\x00\x00\x00\x00j\xf6\x947\xe0\x00\x1d\x00\x16]\x00)\x9b\xc9\xa6g"
+ b"Bw\x8c\xb3\x9eA\x9a\xbeT\xc9\xfa\xe3\x19\x8f(\x00\x00\x00\x00\x00\x96N"
+ b"\xa8\x8ed\xa2WH\x00\x01:\x1e1V \xff\x1f\xb6\xf3}\x01\x00\x00\x00\x00\x04YZ"
)
def decompress(self, data: bytes) -> bytes:
@@ -37,20 +37,18 @@ class XzBase(Base):
class TestStdlib(XzBase):
-
- @pytest.fixture(autouse=True, scope='class')
+ @pytest.fixture(autouse=True, scope="class")
def _setup(self):
try:
- find_binary('xz')
+ find_binary("xz")
except CommandNotFound:
- pytest.skip('xz binary not found')
+ pytest.skip("xz binary not found")
importlib.reload(_xz)
class TestXz(XzBase):
-
- @pytest.fixture(autouse=True, scope='class')
+ @pytest.fixture(autouse=True, scope="class")
def _setup(self):
- with hide_imports('lzma'):
+ with hide_imports("lzma"):
importlib.reload(_xz)
yield