Skip to content

Commit

Permalink
test_lzma: Skip tests requiring extra-filters
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Górny <mgorny@gentoo.org>
  • Loading branch information
mgorny committed Mar 19, 2024
1 parent 60effed commit ebca9c1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Lib/test/test_lzma.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,17 @@ def test_decompressor_raw_1(self):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_1)
self._test_decompressor(lzd, COMPRESSED_RAW_1, lzma.CHECK_NONE)

@unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_decompressor_raw_2(self):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_2)
self._test_decompressor(lzd, COMPRESSED_RAW_2, lzma.CHECK_NONE)

@unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_decompressor_raw_3(self):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_3)
self._test_decompressor(lzd, COMPRESSED_RAW_3, lzma.CHECK_NONE)

@unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_decompressor_raw_4(self):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
self._test_decompressor(lzd, COMPRESSED_RAW_4, lzma.CHECK_NONE)
Expand Down Expand Up @@ -286,12 +289,14 @@ def test_roundtrip_alone(self):
lzd = LZMADecompressor()
self._test_decompressor(lzd, cdata, lzma.CHECK_NONE)

@unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_roundtrip_raw(self):
lzc = LZMACompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
cdata = lzc.compress(INPUT) + lzc.flush()
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
self._test_decompressor(lzd, cdata, lzma.CHECK_NONE)

@unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_roundtrip_raw_empty(self):
lzc = LZMACompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
cdata = lzc.compress(INPUT)
Expand Down Expand Up @@ -441,6 +446,8 @@ def test_decompress_good_input(self):
COMPRESSED_RAW_1, lzma.FORMAT_RAW, filters=FILTERS_RAW_1)
self.assertEqual(ddata, INPUT)

# Gentoo: these require app-arch?xz-utils[extra-filters]
return
ddata = lzma.decompress(
COMPRESSED_RAW_2, lzma.FORMAT_RAW, filters=FILTERS_RAW_2)
self.assertEqual(ddata, INPUT)
Expand All @@ -458,6 +465,8 @@ def test_decompress_incomplete_input(self):
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_ALONE[:128])
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_RAW_1[:128],
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_1)
# Gentoo: these require app-arch?xz-utils[extra-filters]
return
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_RAW_2[:128],
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_2)
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_RAW_3[:128],
Expand Down Expand Up @@ -493,6 +502,8 @@ def test_roundtrip(self):
ddata = lzma.decompress(cdata)
self.assertEqual(ddata, INPUT)

# Gentoo: these require app-arch?xz-utils[extra-filters]
return
cdata = lzma.compress(INPUT, lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
ddata = lzma.decompress(cdata, lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
self.assertEqual(ddata, INPUT)
Expand Down Expand Up @@ -797,6 +808,8 @@ def test_read(self):
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_1) as f:
self.assertEqual(f.read(), INPUT)
self.assertEqual(f.read(), b"")
# Gentoo: these require app-arch?xz-utils[extra-filters]
return
with LZMAFile(BytesIO(COMPRESSED_RAW_2),
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_2) as f:
self.assertEqual(f.read(), INPUT)
Expand Down Expand Up @@ -836,6 +849,8 @@ def test_read_multistream(self):
self.assertEqual(f.read(), INPUT * 5)
with LZMAFile(BytesIO(COMPRESSED_XZ + COMPRESSED_ALONE)) as f:
self.assertEqual(f.read(), INPUT * 2)
# Gentoo: these require app-arch?xz-utils[extra-filters]
return
with LZMAFile(BytesIO(COMPRESSED_RAW_3 * 4),
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_3) as f:
self.assertEqual(f.read(), INPUT * 4)
Expand Down Expand Up @@ -979,6 +994,8 @@ def test_iterator(self):
self.assertListEqual(list(iter(f)), lines)
with LZMAFile(BytesIO(COMPRESSED_ALONE), format=lzma.FORMAT_ALONE) as f:
self.assertListEqual(list(iter(f)), lines)
# Gentoo: these require app-arch?xz-utils[extra-filters]
return
with LZMAFile(BytesIO(COMPRESSED_RAW_2),
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_2) as f:
self.assertListEqual(list(iter(f)), lines)
Expand Down Expand Up @@ -1023,6 +1040,8 @@ def test_write(self):
f.write(INPUT)
expected = lzma.compress(INPUT, format=lzma.FORMAT_ALONE)
self.assertEqual(dst.getvalue(), expected)
# Gentoo: these require app-arch?xz-utils[extra-filters]
return
with BytesIO() as dst:
with LZMAFile(dst, "w", format=lzma.FORMAT_RAW,
filters=FILTERS_RAW_2) as f:
Expand Down

0 comments on commit ebca9c1

Please sign in to comment.