Skip to content

Commit 5e17885

Browse files
committed
test(functional): check mixin behavior with lazy objects
1 parent 24bc3a5 commit 5e17885

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/functional/api/test_mixins.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pytest
2+
3+
4+
@pytest.fixture
5+
def lazy_project(gl, project):
6+
return gl.projects.get(project.path_with_namespace, lazy=True)
7+
8+
9+
def test_refresh_after_lazy_get_with_path(project, lazy_project):
10+
lazy_project.refresh()
11+
assert lazy_project.id == project.id
12+
13+
14+
def test_save_after_lazy_get_with_path(project, lazy_project):
15+
lazy_project.description = "A new description"
16+
lazy_project.save()
17+
assert lazy_project.id == project.id
18+
assert lazy_project.description == "A new description"
19+
20+
21+
@pytest.mark.xfail(reason="See #1494")
22+
def test_delete_after_lazy_get_with_path(gl, lazy_project):
23+
lazy_project.delete()

0 commit comments

Comments
 (0)