Ejemplo 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'
Ejemplo 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))
Ejemplo n.º 3
0
def test_non_strict():
    with tarball_data('empty') as tree:
        assert find_tag(strict=None, git_dir=tree) == 'db3ed35e8734'
Ejemplo n.º 4
0
def test_semver_repo():
    with tarball_data('semver') as tree:
        assert find_tag(git_dir=tree) == 'v2.3.4'
Ejemplo n.º 5
0
def test_empty_repo():
    with tarball_data('empty') as tree, \
            raises(CalledProcessError, match='status 128'):
        find_tag(git_dir=tree)
Ejemplo n.º 6
0
def test_semver_repo():
    with tarball_data('semver') as tree:
        expect(find_tag(git_dir=tree)) == 'v2.3.4'
Ejemplo n.º 7
0
def test_empty_repo():
    with tarball_data('empty') as tree, expect.raises(CalledProcessError):
        find_tag(git_dir=tree)