diff --git a/.gitignore b/.gitignore index 80f96bb7f..a395a5608 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ MANIFEST .idea/ coverage.xml docs/_build -.coverage +.coverage* .python-version .tox .venv/ diff --git a/tests/functional/api/test_mixins.py b/tests/functional/api/test_mixins.py new file mode 100644 index 000000000..1580621d7 --- /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()