diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/api/test_mixins.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/functional/api/test_mixins.py b/tests/functional/api/test_mixins.py new file mode 100644 index 0000000..1580621 --- /dev/null +++ b/tests/functional/api/test_mixins.py @@ -0,0 +1,23 @@ +import pytest + + +@pytest.fixture +def lazy_project(gl, project): + return gl.projects.get(project.path_with_namespace, lazy=True) + + +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" + + +@pytest.mark.xfail(reason="See #1494") +def test_delete_after_lazy_get_with_path(gl, lazy_project): + lazy_project.delete() |