# Path: birdy/utils.py
# BINARY_MIMETYPES = [
#     "application/x-zipped-shp",
#     "application/vnd.google-earth.kmz",
#     "image/tiff; subtype=geotiff",
#     "image/tiff; application=geotiff",
#     "application/x-netcdf",
#     "application/octet-stream",
#     "application/zip",
#     "application/x-gzip",
#     "application/x-gtar",
#     "application/x-tgz",
# ]
# XML_MIMETYPES = ["application/xml", "application/gml+xml", "text/xml"]
# DEFAULT_ENCODING = "utf-8"
# def fix_url(url):
# def is_url(url):
# def is_opendap_url(url):
# def is_file(path):
# def sanitize(name):
# def delist(data):
# def embed(value, mimetype=None, encoding=None):
# def _encode(content, mimetype, encoding):
# def guess_type(url, supported):
# 
# Path: tests/common.py
# def resource_file(filepath):  # noqa: D103
#     return os.path.join(test_directory(), "resources", filepath)


import pytest
from pathlib import Path
from birdy import utils
from .common import resource_file
        from pathlib import Path
def test_is_url():  # noqa: D103
    assert utils.is_url("http://localhost:5000/wps")
    assert utils.is_url("file:///path/to/my/file.txt")
    assert not utils.is_url("myfile.txt")


def test_is_file():  # noqa: D103
    assert not utils.is_file(None)
    assert utils.is_file(resource_file("dummy.nc"))
    long_str = "".join("a" for i in range(260))
    assert not utils.is_file(long_str)
    assert utils.is_file(Path(resource_file("dummy.nc")))


def test_sanitize():  # noqa: D103
    assert utils.sanitize("output") == "output"
    assert utils.sanitize("My Output 1") == "my_output_1"
    assert utils.sanitize("a.b") == "a_b"
    assert utils.sanitize("a-b") == "a_b"
    assert utils.sanitize("return") == "return_"
    assert utils.sanitize("Finally") == "finally_"


def test_delist():  # noqa: D103
    assert utils.delist(["one", "two"]) == ["one", "two"]
    assert utils.delist(["one"]) == "one"
    assert utils.delist("one") == "one"


class TestEncode:  # noqa: D101

# Path: birdy/utils.py
# BINARY_MIMETYPES = [
#     "application/x-zipped-shp",
#     "application/vnd.google-earth.kmz",
#     "image/tiff; subtype=geotiff",
#     "image/tiff; application=geotiff",
#     "application/x-netcdf",
#     "application/octet-stream",
#     "application/zip",
#     "application/x-gzip",
#     "application/x-gtar",
#     "application/x-tgz",
# ]
# XML_MIMETYPES = ["application/xml", "application/gml+xml", "text/xml"]
# DEFAULT_ENCODING = "utf-8"
# def fix_url(url):
# def is_url(url):
# def is_opendap_url(url):
# def is_file(path):
# def sanitize(name):
# def delist(data):
# def embed(value, mimetype=None, encoding=None):
# def _encode(content, mimetype, encoding):
# def guess_type(url, supported):
# 
# Path: tests/common.py
# def resource_file(filepath):  # noqa: D103
#     return os.path.join(test_directory(), "resources", filepath)


# Path: tests/test_utils.py
import pytest
from pathlib import Path
from birdy import utils
from .common import resource_file
        from pathlib import Path

def test_is_url():  # noqa: D103
    assert utils.is_url("http://localhost:5000/wps")
    assert utils.is_url("file:///path/to/my/file.txt")
    assert not utils.is_url("myfile.txt")


def test_is_file():  # noqa: D103
    assert not utils.is_file(None)
    assert utils.is_file(resource_file("dummy.nc"))
    long_str = "".join("a" for i in range(260))
    assert not utils.is_file(long_str)
    assert utils.is_file(Path(resource_file("dummy.nc")))


def test_sanitize():  # noqa: D103
    assert utils.sanitize("output") == "output"
    assert utils.sanitize("My Output 1") == "my_output_1"
    assert utils.sanitize("a.b") == "a_b"
    assert utils.sanitize("a-b") == "a_b"
    assert utils.sanitize("return") == "return_"
    assert utils.sanitize("Finally") == "finally_"


def test_delist():  # noqa: D103
    assert utils.delist(["one", "two"]) == ["one", "two"]
    assert utils.delist(["one"]) == "one"
    assert utils.delist("one") == "one"


class TestEncode:  # noqa: D101

    nc = resource_file("dummy.nc")