Skip to content

Commit b1eb163

Browse files
ref: slight improvement to auto generated types
1 parent b7ba924 commit b1eb163

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

tests/sentry/issues/endpoints/test_organization_group_suspect_flags.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import datetime
22
import time
33
import uuid
4+
from typing import TypedDict
45

56
from sentry.testutils.cases import APITestCase, SnubaTestCase
67

78

9+
class _FlagResult(TypedDict):
10+
flag: str
11+
result: bool
12+
13+
814
class OrganizationGroupSuspectFlagsTestCase(APITestCase, SnubaTestCase):
915
endpoint = "sentry-api-0-organization-group-suspect-flags"
1016

@@ -73,7 +79,7 @@ def _mock_event(
7379
hash: str = "a" * 32,
7480
group_id: int | None = None,
7581
project_id: int = 1,
76-
flags: list[dict[str, object]] | None = None,
82+
flags: list[_FlagResult] | None = None,
7783
) -> None:
7884
self.snuba_insert(
7985
(

tests/sentry/issues/test_suspect_flags.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import datetime
22
import time
33
import uuid
4+
from typing import TypedDict
45

56
from sentry.issues.suspect_flags import (
67
get_suspect_flag_scores,
@@ -10,14 +11,19 @@
1011
from sentry.testutils.cases import SnubaTestCase, TestCase
1112

1213

14+
class _FlagResult(TypedDict):
15+
flag: str
16+
result: bool
17+
18+
1319
class SnubaTest(TestCase, SnubaTestCase):
1420
def mock_event(
1521
self,
1622
ts: datetime.datetime,
1723
hash: str = "a" * 32,
1824
group_id: int | None = None,
1925
project_id: int = 1,
20-
flags: list[dict[str, object]] | None = None,
26+
flags: list[_FlagResult] | None = None,
2127
) -> None:
2228
self.snuba_insert(
2329
(

0 commit comments

Comments
 (0)