test(e2e): cover created team appearing in /team/list (#34015)

This commit is contained in:
Yassin Kortam 2026-07-20 14:27:49 -07:00 • committed by GitHub
parent 53f5a8c380
commit 4c77a5433a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 0 deletions

View file

@ -35,6 +35,7 @@ from models import (
TeamDeleteBody,
TeamInfoParams,
TeamInfoResponse,
TeamListResponse,
TeamMemberAddBody,
TeamMemberDeleteBody,
TeamMemberEntry,
@ -155,6 +156,19 @@ class ManagementClient:
)
).team_info
def team_list_ids(self) -> tuple[str, ...]:
return tuple(
entry.team_id
for entry in unwrap(
self.proxy.transport.get(
"/team/list",
headers=self.proxy.transport.master,
params=NoBody(),
response_type=TeamListResponse,
)
).root
)
def team_info_status(self, team_id: str) -> ProbeResult:
return self.proxy.transport.probe("/team/info", params=TeamInfoParams(team_id=team_id))

View file

@ -227,6 +227,19 @@ class TestTeamRoutes:
f"key generated under team {team_id} carries team_id {key_info.team_id!r} in /key/info"
)
@pytest.mark.covers("mgmt.team.list.happy_path")
def test_created_team_appears_in_team_list(
self, client: ManagementClient, resources: ResourceManager
) -> None:
alias = f"e2e-mgmt-team-{unique_marker()}"
team_id = _create_team(client, resources, alias, ["gemini-2.5-flash"])
_ = _poll(
client,
lambda: team_id if team_id in client.team_list_ids() else None,
f"/team/list never included the created team {team_id}",
)
@pytest.mark.covers("mgmt.team.member_add.persists")
def test_member_add_and_delete_persist_to_team_info(
self, client: ManagementClient, resources: ResourceManager

View file

@ -654,6 +654,15 @@ class TeamDeleteBody(BaseModel):
team_ids: list[str]
class TeamListEntry(BaseModel):
team_id: str
class TeamListResponse(RootModel[list[TeamListEntry]]):
"""GET /team/list answers with a bare array of team objects (not an object
wrapping them). Only team_id is read; pydantic ignores the rest."""
UserRole = Literal["proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer"]