FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
copilot-sdk/python/test_codegen_type_names.py at main · github/copilot-sdk · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github
/
copilot-sdk
Public
Notifications
You must be signed in to change notification settings
Fork
1.4k
Star
10.4k
Code
Issues
229
Pull requests
39
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
copilot-sdk
/
python
/
test_codegen_type_names.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (22 loc) · 988 Bytes
Breadcrumbs
copilot-sdk
/
python
/
test_codegen_type_names.py
Copy path
File metadata and controls
29 lines (22 loc) · 988 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import
re
import
types
from
copilot
.
generated
import
rpc
def
test_permission_approval_exports_are_union_aliases
():
approval_exports
=
[
name
for
name
in
rpc
.
__all__
if
re
.
fullmatch
(
r"PermissionDecisionApproveFor.*Approval"
,
name
)
]
assert
approval_exports
for
name
in
approval_exports
:
exported
=
getattr
(
rpc
,
name
)
assert
isinstance
(
exported
,
types
.
UnionType
), (
f"
{
name
}
must be a union alias, not a synthetic dataclass"
)
def
test_permission_approval_union_loaders_deserialize_expected_variants
():
session
=
rpc
.
_load_PermissionDecisionApproveForSessionApproval
(
{
"kind"
:
"commands"
,
"commandIdentifiers"
: [
"git status"
]}
)
location
=
rpc
.
_load_PermissionDecisionApproveForLocationApproval
({
"kind"
:
"read"
})
assert
isinstance
(
session
,
rpc
.
PermissionDecisionApproveForSessionApprovalCommands
)
assert
isinstance
(
location
,
rpc
.
PermissionDecisionApproveForLocationApprovalRead
)
Back
|
FazBrowse Home
|
New Git URL