Add unit testing of gitlab trigger handler

This commit is contained in:
Joseph Schorr 2017-02-13 17:42:37 -05:00
parent 84b298f36b
commit 57528aa2bc
4 changed files with 287 additions and 7 deletions

View file

@ -3,9 +3,12 @@ import pytest
from buildtrigger.triggerutil import TriggerStartException
from buildtrigger.test.bitbucketmock import get_bitbucket_trigger
from buildtrigger.test.githubmock import get_github_trigger
from buildtrigger.test.gitlabmock import get_gitlab_trigger
from endpoints.building import PreparedBuild
@pytest.fixture(params=[get_github_trigger(), get_bitbucket_trigger()])
# Note: This test suite executes a common set of tests against all the trigger types specified
# in this fixture. Each trigger's mock is expected to return the same data for all of these calls.
@pytest.fixture(params=[get_github_trigger(), get_bitbucket_trigger(), get_gitlab_trigger()])
def githost_trigger(request):
return request.param
@ -111,7 +114,6 @@ def test_list_build_sources_for_namespace(namespace, expected, githost_trigger):
def test_activate(githost_trigger):
config, private_key = githost_trigger.activate('http://some/url')
assert 'deploy_key_id' in config
assert 'private_key' in private_key