2017-02-28 07:24:53 +00:00
|
|
|
# MIT licensed
|
|
|
|
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
|
|
|
2015-11-05 07:31:56 +00:00
|
|
|
import os
|
|
|
|
import pytest
|
2017-07-04 09:04:29 +00:00
|
|
|
pytestmark = [pytest.mark.asyncio,
|
|
|
|
pytest.mark.skipif("NVCHECKER_GITLAB_TOKEN_GITLAB_COM" not in os.environ,
|
|
|
|
reason="requires NVCHECKER_GITLAB_TOKEN_GITLAB_COM")]
|
2015-11-05 07:31:56 +00:00
|
|
|
|
2017-07-04 09:04:29 +00:00
|
|
|
async def test_gitlab(get_version):
|
|
|
|
ver = await get_version("example",
|
|
|
|
{"gitlab": "gitlab-org/gitlab-test"})
|
|
|
|
assert len(ver) == 8
|
|
|
|
assert ver.isdigit()
|
2015-11-05 07:31:56 +00:00
|
|
|
|
2017-07-04 09:04:29 +00:00
|
|
|
async def test_gitlab_max_tag(get_version):
|
|
|
|
assert await get_version("example", {"gitlab": "gitlab-org/gitlab-test", "use_max_tag": 1}) == "v1.1.0"
|
2015-11-05 07:31:56 +00:00
|
|
|
|
2017-07-04 09:04:29 +00:00
|
|
|
async def test_gitlab_max_tag_with_ignored_tags(get_version):
|
|
|
|
assert await get_version("example", {"gitlab": "gitlab-org/gitlab-test", "use_max_tag": 1, "ignored_tags": "v1.1.0"}) == "v1.0.0"
|