mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 09:59:19 -04:00
Merge pull request #9290 from MultisampledNight/fix-padme-ui
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
Fix padme UI
This commit is contained in:
commit
26bde193b6
2 changed files with 4 additions and 4 deletions
|
|
@ -713,8 +713,8 @@ class CompressionSpec:
|
|||
elif self.name == 'obfuscate':
|
||||
if 3 <= count <= 5:
|
||||
level = int(values[1])
|
||||
if not ((1 <= level <= 6) or (110 <= level <= 123)):
|
||||
raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123")
|
||||
if not ((1 <= level <= 6) or (110 <= level <= 123) or (level == 250)):
|
||||
raise ArgumentTypeError("level must be (inclusively) within 1...6, 110...123 or equal to 250")
|
||||
self.level = level
|
||||
compression = ','.join(values[2:])
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ def test_invalid_compression_level(invalid_spec):
|
|||
],
|
||||
)
|
||||
def test_padme_obfuscation(data_length, expected_padding):
|
||||
compressor = Compressor(name="obfuscate", level=250, compressor=Compressor("none"))
|
||||
compressor = CompressionSpec("obfuscate,250,none").compressor
|
||||
data = b"x" * data_length
|
||||
meta, compressed = compressor.compress(dict(type=ROBJ_FILE_STREAM), data)
|
||||
|
||||
|
|
@ -251,7 +251,7 @@ def test_padme_obfuscation(data_length, expected_padding):
|
|||
],
|
||||
)
|
||||
def test_robj_specific_obfuscation(data_length, expected_padding, robj_type):
|
||||
compressor = Compressor(name="obfuscate", level=250, compressor=Compressor("none"))
|
||||
compressor = CompressionSpec("obfuscate,250,none").compressor
|
||||
data = b"x" * data_length
|
||||
meta, compressed = compressor.compress(dict(type=robj_type), data)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue