FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/tests/functional/api/test_graphql.py at main · netflash/python-gitlab · GitHub
netflash
python-gitlab
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
tests
/
functional
/
api
/
test_graphql.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (17 loc) · 781 Bytes
Breadcrumbs
python-gitlab
/
tests
/
functional
/
api
/
test_graphql.py
Copy path
File metadata and controls
28 lines (17 loc) · 781 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
import
pytest
import
gitlab
@
pytest
.
fixture
def
gl_gql
(
gitlab_url
:
str
,
gitlab_token
:
str
)
->
gitlab
.
GraphQL
:
return
gitlab
.
GraphQL
(
gitlab_url
,
token
=
gitlab_token
)
@
pytest
.
fixture
def
gl_async_gql
(
gitlab_url
:
str
,
gitlab_token
:
str
)
->
gitlab
.
AsyncGraphQL
:
return
gitlab
.
AsyncGraphQL
(
gitlab_url
,
token
=
gitlab_token
)
def
test_query_returns_valid_response
(
gl_gql
:
gitlab
.
GraphQL
):
query
=
"query {currentUser {active}}"
response
=
gl_gql
.
execute
(
query
)
assert
response
[
"currentUser"
][
"active"
]
is
True
@
pytest
.
mark
.
anyio
async
def
test_async_query_returns_valid_response
(
gl_async_gql
:
gitlab
.
AsyncGraphQL
):
query
=
"query {currentUser {active}}"
response
=
await
gl_async_gql
.
execute
(
query
)
assert
response
[
"currentUser"
][
"active"
]
is
True
Back
|
FazBrowse Home
|
New Git URL