Buckets:

download
raw
739 Bytes
import pytest
from langserve.playground import _get_mimetype
@pytest.mark.parametrize(
"file_extension, expected_mimetype",
[
("js", "application/javascript"),
("css", "text/css"),
("htm", "text/html"),
("html", "text/html"),
("txt", "text/plain"), # An example of an unknown extension using guess_type
],
)
def test_get_mimetype(file_extension: str, expected_mimetype: str) -> None:
# Create a filename with the given extension
filename = f"test_file.{file_extension}"
# Call the _get_mimetype function with the test filename
mimetype = _get_mimetype(filename)
# Check if the returned mimetype matches the expected one
assert mimetype == expected_mimetype

Xet Storage Details

Size:
739 Bytes
·
Xet hash:
62e024340a86f95c7b6d1317423a54b5a8d616ae64dcc75217175205dff1da92

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.