Skip to content

Commit

Permalink
fix: rebase cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
qvalentin committed Nov 21, 2024
1 parent 9011c97 commit ddbe7ab
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions backend/tests/test_server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import datetime # Added import for datetime
import datetime
import os
import pathlib
from pathlib import Path
Expand All @@ -9,18 +9,13 @@
from fastapi.testclient import TestClient

from chainlit.auth import get_current_user
from chainlit.config import APP_ROOT, ChainlitConfig
from chainlit.config import (
APP_ROOT,
ChainlitConfig,
SpontaneousFileUploadFeature,
load_config,
)
from chainlit.server import app
from chainlit.session import WebsocketSession
from chainlit.types import FileReference
from chainlit.user import PersistedUser # Added import for PersistedUser
from fastapi.testclient import TestClient
from chainlit.user import PersistedUser


@pytest.fixture
Expand Down Expand Up @@ -328,7 +323,7 @@ def test_get_file_non_existing_session(

# Attempt to access the file without authentication by providing an invalid session_id
response = test_client.get(
f"/project/file/nonexistent?session_id=unauthenticated_session_id"
"/project/file/nonexistent?session_id=unauthenticated_session_id"
)

# Verify the response
Expand Down Expand Up @@ -538,7 +533,7 @@ def test_upload_file_disabled(


@pytest.mark.parametrize(
"accept_pattern, mime_type, expected_status",
("accept_pattern", "mime_type", "expected_status"),
[
({"image/*": [".png", ".gif", ".jpeg", ".jpg"]}, "image/jpeg", 400),
(["image/*"], "text/plain", 400),
Expand Down Expand Up @@ -620,7 +615,7 @@ def test_upload_file_mime_type_check(


@pytest.mark.parametrize(
"file_content, content_multiplier, max_size_mb, expected_status",
("file_content", "content_multiplier", "max_size_mb", "expected_status"),
[
(b"1", 1, 1, 200),
(b"11", 1024 * 1024, 1, 400),
Expand Down

0 comments on commit ddbe7ab

Please sign in to comment.