Skip to content

Commit dfdb077

Browse files
committed
Test web endpoint
1 parent 7f3ca3e commit dfdb077

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/function_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,11 +1488,16 @@ def f(a: int) -> list[str]: ...
14881488
def test_function_data_format_compatibility(client, servicer):
14891489
app = App("app")
14901490

1491-
@app.function(name="f", serialized=True)
1491+
@app.function(serialized=True)
14921492
def f(a: int) -> list[str]: ...
14931493

1494+
@app.function(serialized=True)
1495+
@modal.fastapi_endpoint()
1496+
def web_f(a: int) -> list[str]: ...
1497+
14941498
deploy_app(app, client=client)
14951499
assert set(f._get_metadata().data_format_compatibility) == {api_pb2.DATA_FORMAT_PICKLE, api_pb2.DATA_FORMAT_CBOR}
1500+
assert set(web_f._get_metadata().data_format_compatibility) == {api_pb2.DATA_FORMAT_ASGI}
14961501

14971502

14981503
@pytest.mark.usefixtures("set_env_client")

0 commit comments

Comments
 (0)