Repository: gradio-app/gradio
File: test/test_routes.py (Python)

Code before:
    client = TestClient(app)
    config = client.get("/config").json()
    assert config["footer_links"] == ["gradio", "settings"]
    demo.close()

    app, _, _ = demo.launch(
        prevent_thread_lock=True, footer_links=["gradio", "settings"]
    )
    client = TestClient(app)
    config = client.get("/config").json()
    assert config["footer_links"] == ["gradio", "settings"]
    demo.close()


def test_config_show_api_reflects_mount_flag():
    app = FastAPI()
    with gr.Blocks() as demo:
        gr.Markdown("Hello")

    gr.mount_gradio_app(app, demo, path="/gr", footer_links=["gradio", "settings"])
    client = TestClient(app)
    config = client.get("/gr/config").json()
    assert config["footer_links"] == ["gradio", "settings"]


def test_empty_footer_links():
    with gr.Blocks() as demo:
        gr.Markdown("Hello")

    app, _, _ = demo.launch(prevent_thread_lock=True, footer_links=[])
    client = TestClient(app)
    config = client.get("/config").json()
    assert config["footer_links"] == []
    demo.close()


def test_orjson_serialization():
    df = pd.DataFrame(
        {
            "date_1": pd.date_range("2021-01-01", periods=2),
            "date_2": pd.date_range("2022-02-15", periods=2).strftime("%B %d, %Y, %r"),
            "number": np.array([0.2233, 0.57281]),
            "number_2": np.array([84, 23]).astype(np.int64),
            "bool": [True, False],
            "markdown": ["# Hello", "# Goodbye"],
        }
    )

    with gr.Blocks() as demo:
        gr.DataFrame(df)
    app, _, _ = demo.launch(prevent_thread_lock=True)

Review comment (suggestion):
```suggestion
def test_empty_footer_links():
    with gr.Blocks() as demo:
        gr.Markdown("Hello")
    try:
       app, _, _ = demo.launch(prevent_thread_lock=True, footer_links=[])
       client = TestClient(app)
       config = client.get("/config").json()
       assert config["footer_links"] == []
    finally:
        demo.close()
```

Code after:
    client = TestClient(app)
    config = client.get("/config").json()
    assert config["footer_links"] == ["gradio", "settings"]
    demo.close()

    app, _, _ = demo.launch(
        prevent_thread_lock=True, footer_links=["gradio", "settings"]
    )
    client = TestClient(app)
    config = client.get("/config").json()
    assert config["footer_links"] == ["gradio", "settings"]
    demo.close()


def test_config_show_api_reflects_mount_flag():
    app = FastAPI()
    with gr.Blocks() as demo:
        gr.Markdown("Hello")

    gr.mount_gradio_app(app, demo, path="/gr", footer_links=["gradio", "settings"])
    client = TestClient(app)
    config = client.get("/gr/config").json()
    assert config["footer_links"] == ["gradio", "settings"]


def test_empty_footer_links():
    with gr.Blocks() as demo:
        gr.Markdown("Hello")
    try:
        app, _, _ = demo.launch(prevent_thread_lock=True, footer_links=[])
        client = TestClient(app)
        config = client.get("/config").json()
        assert config["footer_links"] == []
    finally:
        demo.close()
    with gr.Blocks() as demo:
        gr.Markdown("Hello")

    app, _, _ = demo.launch(prevent_thread_lock=True, footer_links=[])
    client = TestClient(app)
    config = client.get("/config").json()
    assert config["footer_links"] == []
    demo.close()


def test_orjson_serialization():
    df = pd.DataFrame(
        {
            "date_1": pd.date_range("2021-01-01", periods=2),
            "date_2": pd.date_range("2022-02-15", periods=2).strftime("%B %d, %Y, %r"),
            "number": np.array([0.2233, 0.57281]),