Esempio n. 1
0
def test_custom_match():
    with tarball_data('funky_names') as tree:
        assert find_tag('prefix[0-9]*', git_dir=tree) == 'prefix9.8.7.6'
Esempio n. 2
0
def find_tag(match: str, strict: bool, directory: str):
    """Find tag for git repository."""
    with suppress(CalledProcessError):
        echo(git.find_tag(match, strict=strict, git_dir=directory))
Esempio n. 3
0
def test_non_strict():
    with tarball_data('empty') as tree:
        assert find_tag(strict=None, git_dir=tree) == 'db3ed35e8734'
Esempio n. 4
0
def test_semver_repo():
    with tarball_data('semver') as tree:
        assert find_tag(git_dir=tree) == 'v2.3.4'
Esempio n. 5
0
def test_empty_repo():
    with tarball_data('empty') as tree, \
            raises(CalledProcessError, match='status 128'):
        find_tag(git_dir=tree)
Esempio n. 6
0
def test_semver_repo():
    with tarball_data('semver') as tree:
        expect(find_tag(git_dir=tree)) == 'v2.3.4'
Esempio n. 7
0
def test_empty_repo():
    with tarball_data('empty') as tree, expect.raises(CalledProcessError):
        find_tag(git_dir=tree)