Skip to content

test(functional): check mixin behavior with lazy objects #1824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MANIFEST
.idea/
coverage.xml
docs/_build
.coverage
.coverage*
.python-version
.tox
.venv/
Expand Down
23 changes: 23 additions & 0 deletions tests/functional/api/test_mixins.py
Original file line number Diff line number Diff line change
@@ -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()