2020-08-17 08:31:59 +00:00
|
|
|
# MIT licensed
|
|
|
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
|
|
|
|
|
|
|
async def test_bitbucket(get_version):
|
|
|
|
assert await get_version("example", {
|
|
|
|
"source": "bitbucket",
|
|
|
|
"bitbucket": "prawee/git-tag",
|
|
|
|
}) == "20150303"
|
|
|
|
|
|
|
|
async def test_bitbucket_max_tag(get_version):
|
|
|
|
assert await get_version("example", {
|
|
|
|
"source": "bitbucket",
|
|
|
|
"bitbucket": "prawee/git-tag",
|
|
|
|
"use_max_tag": True,
|
|
|
|
}) == "1.7.0"
|
|
|
|
|
2020-08-18 08:35:26 +00:00
|
|
|
async def test_bitbucket_max_tag_with_ignored(get_version):
|
2020-08-17 08:31:59 +00:00
|
|
|
assert await get_version("example", {
|
|
|
|
"source": "bitbucket",
|
|
|
|
"bitbucket": "prawee/git-tag",
|
|
|
|
"use_max_tag": True,
|
2020-08-18 08:35:26 +00:00
|
|
|
"ignored": "1.6.0 1.7.0",
|
2020-08-17 08:31:59 +00:00
|
|
|
}) == "v1.5"
|
2022-02-04 16:31:41 +00:00
|
|
|
|
|
|
|
async def test_bitbucket_sorted_tags(get_version):
|
|
|
|
assert await get_version("example", {
|
|
|
|
"source": "bitbucket",
|
|
|
|
"bitbucket": "prawee/git-tag",
|
|
|
|
"use_sorted_tags": True,
|
|
|
|
}) == "1.7.0"
|
|
|
|
|
|
|
|
assert await get_version("example", {
|
|
|
|
"source": "bitbucket",
|
|
|
|
"bitbucket": "prawee/git-tag",
|
|
|
|
"use_sorted_tags": True,
|
|
|
|
"query": 'name~"v"',
|
|
|
|
}) == "v1.5"
|
|
|
|
|
|
|
|
assert await get_version("example", {
|
|
|
|
"source": "bitbucket",
|
|
|
|
"bitbucket": "berkeleylab/gasnet",
|
|
|
|
"use_sorted_tags": True,
|
|
|
|
"query": 'name~"CVS/BERKELEY_UPC" AND name!~"rc"',
|
|
|
|
"prefix": "CVS/BERKELEY_UPC_",
|
|
|
|
}) == "2_18_0"
|