gitlab_runner: Fix idempotency when creating runner (#57833)
(cherry picked from commit ec7b18952b)
This commit is contained in:
committed by
Toshio Kuratomi
parent
fa6e39ddf2
commit
36df5d22a4
@ -9,7 +9,7 @@ from ansible.modules.source_control.gitlab_runner import GitLabRunner
|
||||
|
||||
from .gitlab import (GitlabModuleTestCase,
|
||||
python_version_match_requirement,
|
||||
resp_find_runners, resp_get_runner,
|
||||
resp_find_runners_list, resp_get_runner,
|
||||
resp_create_runner, resp_delete_runner)
|
||||
|
||||
# Gitlab module requirements
|
||||
@ -26,7 +26,7 @@ class TestGitlabRunner(GitlabModuleTestCase):
|
||||
|
||||
self.moduleUtil = GitLabRunner(module=self.mock_module, gitlab_instance=self.gitlab_instance)
|
||||
|
||||
@with_httmock(resp_find_runners)
|
||||
@with_httmock(resp_find_runners_list)
|
||||
@with_httmock(resp_get_runner)
|
||||
def test_runner_exist(self):
|
||||
rvalue = self.moduleUtil.existsRunner("test-1-20150125")
|
||||
@ -44,7 +44,7 @@ class TestGitlabRunner(GitlabModuleTestCase):
|
||||
self.assertEqual(type(runner), Runner)
|
||||
self.assertEqual(runner.description, "test-1-20150125")
|
||||
|
||||
@with_httmock(resp_find_runners)
|
||||
@with_httmock(resp_find_runners_list)
|
||||
@with_httmock(resp_get_runner)
|
||||
def test_update_runner(self):
|
||||
runner = self.moduleUtil.findRunner("test-1-20150125")
|
||||
@ -60,7 +60,7 @@ class TestGitlabRunner(GitlabModuleTestCase):
|
||||
self.assertEqual(changed, False)
|
||||
self.assertEqual(newRunner.description, "Runner description")
|
||||
|
||||
@with_httmock(resp_find_runners)
|
||||
@with_httmock(resp_find_runners_list)
|
||||
@with_httmock(resp_get_runner)
|
||||
@with_httmock(resp_delete_runner)
|
||||
def test_delete_runner(self):
|
||||
|
||||
Reference in New Issue
Block a user