FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/tests/functional/api/test_lazy_objects.py at main · python-gitlab/python-gitlab · GitHub
python-gitlab
python-gitlab
Repository navigation
Code
Issues
16
(16)
Pull requests
15
(15)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
tests
/
functional
/
api
/
test_lazy_objects.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (27 loc) · 1.26 KB
Breadcrumbs
python-gitlab
/
tests
/
functional
/
api
/
test_lazy_objects.py
Copy path
File metadata and controls
41 lines (27 loc) · 1.26 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
import
time
import
pytest
import
gitlab
@
pytest
.
fixture
def
lazy_project
(
gl
,
project
):
assert
"/"
in
project
.
path_with_namespace
return
gl
.
projects
.
get
(
project
.
path_with_namespace
,
lazy
=
True
)
def
test_lazy_id
(
project
,
lazy_project
):
assert
isinstance
(
lazy_project
.
id
,
str
)
assert
isinstance
(
lazy_project
.
id
,
gitlab
.
utils
.
EncodedId
)
assert
lazy_project
.
id
==
gitlab
.
utils
.
EncodedId
(
project
.
path_with_namespace
)
def
test_refresh_after_lazy_get_with_path
(
project
,
lazy_project
):
lazy_project
.
refresh
()
assert
lazy_project
.
id
==
project
.
id
def
test_save_after_lazy_get_with_path
(
project
,
lazy_project
):
lazy_project
.
description
=
"A new description"
lazy_project
.
save
()
assert
lazy_project
.
id
==
project
.
id
assert
lazy_project
.
description
==
"A new description"
def
test_delete_after_lazy_get_with_path
(
gl
,
group
):
project
=
gl
.
projects
.
create
({
"name"
:
"lazy_project"
,
"namespace_id"
:
group
.
id
})
# Pause to let GL catch up (happens on hosted too, sometimes takes a while for server to be ready to merge)
time
.
sleep
(
5
)
lazy_project
=
gl
.
projects
.
get
(
project
.
path_with_namespace
,
lazy
=
True
)
lazy_project
.
delete
()
def
test_list_children_after_lazy_get_with_path
(
gl
,
lazy_project
):
lazy_project
.
mergerequests
.
list
()
Back
|
FazBrowse Home
|
New Git URL