mirror of
https://github.com/langgenius/dify.git
synced 2026-03-11 03:29:44 +08:00
test: align file preview mimetype expectation (#32688)
This commit is contained in:
parent
661af404e9
commit
149a7870bc
@ -273,9 +273,10 @@ class TestWebAppAuthService:
|
||||
# Arrange: Create banned account
|
||||
fake = Faker()
|
||||
password = fake.password(length=12)
|
||||
unique_email = f"test_{uuid.uuid4().hex[:8]}@example.com"
|
||||
|
||||
account = Account(
|
||||
email=fake.email(),
|
||||
email=unique_email,
|
||||
name=fake.name(),
|
||||
interface_language="en-US",
|
||||
status=AccountStatus.BANNED,
|
||||
@ -426,8 +427,7 @@ class TestWebAppAuthService:
|
||||
- Correct return value (None)
|
||||
"""
|
||||
# Arrange: Use non-existent email
|
||||
fake = Faker()
|
||||
non_existent_email = fake.email()
|
||||
non_existent_email = f"nonexistent_{uuid.uuid4().hex}@example.com"
|
||||
|
||||
# Act: Execute user retrieval
|
||||
result = WebAppAuthService.get_user_through_email(non_existent_email)
|
||||
|
||||
@ -107,7 +107,7 @@ class TestFilePreviewApi:
|
||||
|
||||
response = get_fn("file-id")
|
||||
|
||||
assert response.mimetype == "text/plain"
|
||||
assert response.mimetype == "application/octet-stream"
|
||||
assert response.headers["Content-Length"] == "100"
|
||||
assert "Accept-Ranges" not in response.headers
|
||||
mock_enforce.assert_called_once()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user