Skip to content

Commit 3f94170

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

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/functional/api/test_mixins.py

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy