diff --git a/exasol/toolbox/git.py b/exasol/toolbox/git.py index f38d2cc8..a999d43c 100644 --- a/exasol/toolbox/git.py +++ b/exasol/toolbox/git.py @@ -1,4 +1,4 @@ -from subprocess import run +import subprocess from typing import Iterable @@ -11,5 +11,5 @@ def tags() -> Iterable[str]: - the code is executed where the working directory is within a git repository """ command = ["git", "tag", "--sort=committerdate"] - result = run(command, capture_output=True, check=True) + result = subprocess.run(command, capture_output=True, check=True) return [tag.strip() for tag in result.stdout.decode("utf-8").splitlines()] diff --git a/test/unit/git_test.py b/test/unit/git_test.py index 591035e1..55890b0f 100644 --- a/test/unit/git_test.py +++ b/test/unit/git_test.py @@ -14,6 +14,7 @@ def git_tag(): returncode=0, stdout=cleandoc( """ + 0.0.1 0.1.0 0.2.0 0.3.0 @@ -25,7 +26,7 @@ def git_tag(): 0.7.0 0.8.0 """ - ), + ).encode("utf8"), stderr="", ) yield result @@ -34,6 +35,7 @@ def git_tag(): def test_git_tags(git_tag): expected = sorted( [ + "0.0.1", "0.1.0", "0.2.0", "0.3.0",