mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-21 01:05:30 +00:00
tests: Fix logo tests.
Some checks are pending
Backend Tests / Plan test groups (push) Waiting to run
Backend Tests / (push) Blocked by required conditions
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Waiting to run
Some checks are pending
Backend Tests / Plan test groups (push) Waiting to run
Backend Tests / (push) Blocked by required conditions
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Waiting to run
This commit is contained in:
parent
66089f14ee
commit
cdba6dac84
1 changed files with 6 additions and 2 deletions
|
|
@ -14,8 +14,10 @@ from core.utils import resolve_safe_local_data_path, safe_upload_path
|
|||
|
||||
class ResolveSafeLocalDataPathTests(TestCase):
|
||||
def test_accepts_file_under_logos_root(self):
|
||||
logos_root = Path("/data/logos")
|
||||
logos_root.mkdir(parents=True, exist_ok=True)
|
||||
name = f"_jail_test_{uuid.uuid4().hex}.png"
|
||||
target = Path("/data/logos") / name
|
||||
target = logos_root / name
|
||||
target.write_bytes(b"x")
|
||||
try:
|
||||
resolved = resolve_safe_local_data_path(
|
||||
|
|
@ -63,8 +65,10 @@ class LogoCachePathJailTests(TestCase):
|
|||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
def test_valid_local_logo_is_served(self):
|
||||
logos_root = Path("/data/logos")
|
||||
logos_root.mkdir(parents=True, exist_ok=True)
|
||||
name = f"_jail_serve_{uuid.uuid4().hex}.png"
|
||||
file_path = Path("/data/logos") / name
|
||||
file_path = logos_root / name
|
||||
file_path.write_bytes(b"\x89PNG\r\n\x1a\n")
|
||||
logo = Logo.objects.create(name="Ok", url=str(file_path))
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue