def test_extension_from_mimetype(tempdir):
    with working_directory(tempdir.path):
        files = pull_http({"url": "https://httpbin.org/get"})
        assert files["get.json"]["mimetype"] == "application/json"

        files = pull_http({"url": "https://httpbin.org/image/png"}, path="image")
        assert files["image.png"]["mimetype"] == "image/png"

        files = pull_http({"url": "https://httpbin.org/html"}, path="content")
        assert files["content.html"]["mimetype"] == "text/html"

        files = pull_http({"url": "https://httpbin.org/html"}, path="foo.bar")
        assert files["foo.bar"]["mimetype"] is None