Skip to content

Commit 2f9b29d

Browse files
committed
add test
1 parent 870eda0 commit 2f9b29d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

projects/fal/tests/test_apps.py

+33
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,39 @@ def test_404_response(test_app: str, request: pytest.FixtureRequest):
516516
apps.run(test_app, path="/other", arguments={"lhs": 1, "rhs": 2})
517517

518518

519+
def test_app_deploy_scale(aliased_app: tuple[str, str]):
520+
app_revision, app_alias = aliased_app
521+
522+
host: api.FalServerlessHost = addition_app.host # type: ignore
523+
kwargs = dict(
524+
func=addition_app.func,
525+
options=addition_app.options,
526+
application_name=app_alias,
527+
application_auth_mode="private",
528+
max_multiplexing=30,
529+
)
530+
531+
with host._connection as client:
532+
app_revision = client.register(**kwargs, scale=False)
533+
534+
with host._connection as client:
535+
res = client.list_aliases()
536+
found = next(filter(lambda alias: alias.alias == app_alias, res), None)
537+
assert found, f"Could not find app {app_alias} in {res}"
538+
assert found.revision == app_revision
539+
assert found.max_multiplexing == 1
540+
541+
with host._connection as client:
542+
app_revision = client.register(**kwargs, scale=True)
543+
544+
with host._connection as client:
545+
res = client.list_aliases()
546+
found = next(filter(lambda alias: alias.alias == app_alias, res), None)
547+
assert found, f"Could not find app {app_alias} in {res}"
548+
assert found.revision == app_revision
549+
assert found.max_multiplexing == 30
550+
551+
519552
def test_app_update_app(aliased_app: tuple[str, str]):
520553
app_revision, app_alias = aliased_app
521554

0 commit comments

Comments
 (0)