|
10 | 10 | from sentry.models.group import Group |
11 | 11 | from sentry.models.groupassignee import GroupAssignee |
12 | 12 | from sentry.models.repository import Repository |
| 13 | +from sentry.seer.endpoints.seer_rpc import get_organization_project_ids |
13 | 14 | from sentry.seer.explorer.tools import ( |
14 | 15 | execute_trace_query_chart, |
15 | 16 | execute_trace_query_table, |
@@ -371,17 +372,22 @@ def test_execute_trace_query_table_aggregates_mode_multiple_functions(self): |
371 | 372 |
|
372 | 373 | def test_get_organization_project_ids(self): |
373 | 374 | """Test the get_organization_project_ids RPC method""" |
374 | | - from sentry.seer.endpoints.seer_rpc import get_organization_project_ids |
375 | | - |
376 | 375 | # Test with valid organization |
377 | 376 | result = get_organization_project_ids(org_id=self.organization.id) |
378 | | - assert "project_ids" in result |
379 | | - assert isinstance(result["project_ids"], list) |
380 | | - assert self.project.id in result["project_ids"] |
| 377 | + assert "projects" in result |
| 378 | + assert isinstance(result["projects"], list) |
| 379 | + assert len(result["projects"]) > 0 |
| 380 | + # Check that projects have both id and slug |
| 381 | + project = result["projects"][0] |
| 382 | + assert "id" in project |
| 383 | + assert "slug" in project |
| 384 | + # Check that our project is in the results |
| 385 | + project_ids = [p["id"] for p in result["projects"]] |
| 386 | + assert self.project.id in project_ids |
381 | 387 |
|
382 | 388 | # Test with nonexistent organization |
383 | 389 | result = get_organization_project_ids(org_id=99999) |
384 | | - assert result == {"project_ids": []} |
| 390 | + assert result == {"projects": []} |
385 | 391 |
|
386 | 392 |
|
387 | 393 | class TestGetTraceWaterfall(APITransactionTestCase, SpanTestCase, SnubaTestCase): |
|
0 commit comments