forked from kenzuya/unshackle
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -92,11 +92,6 @@ def test_no_signature_is_refused() -> None:
|
||||
ClearKeyCTR(lambda: KEY, IV, b"")
|
||||
|
||||
|
||||
def test_negative_skip_is_refused() -> None:
|
||||
with pytest.raises(ValueError, match="skip"):
|
||||
keyed(skip=-1)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("header_size", [167, (1 << 20) + 167], ids=["short", "longer-than-one-chunk"])
|
||||
def test_skip_drops_a_header_in_front_of_the_media(tmp_path: Path, header_size: int) -> None:
|
||||
header, plain = os.urandom(header_size), MAGIC + os.urandom((1 << 20) + 5)
|
||||
@@ -120,16 +115,6 @@ def test_skip_past_the_end_raises_and_keeps_the_input(tmp_path: Path) -> None:
|
||||
assert path.read_bytes() == encrypted
|
||||
|
||||
|
||||
def test_magic_accepts_the_expected_signature(tmp_path: Path) -> None:
|
||||
path = tmp_path / "track.flac"
|
||||
path.write_bytes(ctr_encrypt(b"fLaC" + os.urandom(5000)))
|
||||
|
||||
keyed(magic=b"fLaC").decrypt(path)
|
||||
|
||||
assert path.read_bytes().startswith(b"fLaC")
|
||||
assert list(tmp_path.iterdir()) == [path]
|
||||
|
||||
|
||||
TRIMMABLE = header(FIRST, total=7081, first_record=config_record(true=1000)) + FIRST
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user