mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-26 16:42:27 +00:00
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
# MIT licensed
|
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
|
|
import shutil
|
|
import pytest
|
|
pytestmark = pytest.mark.asyncio
|
|
|
|
|
|
@pytest.mark.skipif(shutil.which("git") is None,
|
|
reason="requires git command")
|
|
async def test_git(get_version):
|
|
assert await get_version("example", {
|
|
"source": "vcs",
|
|
"vcs": "git+https://github.com/harry-sanabria/ReleaseTestRepo.git",
|
|
}) == "1.1.2b3cdf6134b07ae6ac77f11b586dc1ae6d1521db"
|
|
|
|
@pytest.mark.skipif(shutil.which("git") is None,
|
|
reason="requires git command")
|
|
async def test_git_max_tag(get_version):
|
|
assert await get_version("example", {
|
|
"source": "vcs",
|
|
"vcs": "git+https://github.com/harry-sanabria/ReleaseTestRepo.git",
|
|
"use_max_tag": 1,
|
|
}) == "second_release"
|
|
|
|
@pytest.mark.skipif(shutil.which("git") is None,
|
|
reason="requires git command")
|
|
async def test_git_max_tag_with_ignored(get_version):
|
|
assert await get_version("example", {
|
|
"source": "vcs",
|
|
"vcs": "git+https://github.com/harry-sanabria/ReleaseTestRepo.git",
|
|
"use_max_tag": 1,
|
|
"ignored": "second_release release3",
|
|
}) == "first_release"
|