diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2022-01-10 02:27:26 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2022-01-10 02:30:50 +0100 |
commit | 5e178857d51eae44e6feba4a05d0dd39a41d5fe0 (patch) | |
tree | 7d2347201fbd70697e3b8ad48df29983d0fd8c29 | |
parent | 24bc3a52b9c8294d88ef54a0df00e31e8a434f05 (diff) | |
download | gitlab-test/lazy-get-mixins.tar.gz |
test(functional): check mixin behavior with lazy objectstest/lazy-get-mixins
-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() |