From d0c665b3e3835cb77a6b5fe8bfc011212c76253b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Kolbu?= Date: Fri, 27 Jan 2023 11:42:34 +0100 Subject: [PATCH] (testing) Test Repository patching --- tests/test_api.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_api.py b/tests/test_api.py index a06fbe7..f08dc51 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -127,6 +127,24 @@ def test_create_repo_orgowned(instance): assert repo.name == test_repo assert not repo.private + +def test_patch_repo(instance): + fields = { + "allow_rebase": False, + "description": "new description", + "has_projects": True, + "private": True, + } + org = Organization.request(instance, test_org) + repo = org.get_repository(test_repo) + for field, value in fields.items(): + setattr(repo, field, value) + repo.commit() + repo = org.get_repository(test_repo) + for field, value in fields.items(): + assert getattr(repo, field) == value + + def test_list_branches(instance): org = Organization.request(instance, test_org) repo = org.get_repository(test_repo)