From 022d577274d42e5f885ef87b5cde310ee278df05 Mon Sep 17 00:00:00 2001 From: Derek DeJonghe Date: Tue, 16 Jun 2020 15:38:05 -0400 Subject: [PATCH] fix if --- semver/get_version.py | 2 +- semver/tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/semver/get_version.py b/semver/get_version.py index d3cd0d5..9fb47d4 100644 --- a/semver/get_version.py +++ b/semver/get_version.py @@ -31,7 +31,7 @@ def get_version(build=0,version_format=None,dot=False): bump_output = p.stdout.read().decode('utf-8').rstrip() next_version = re.search("new_version=([0-9]*.[0-9]*.[0-9]*)", bump_output).group(1) - if version_format is 'npm' or 'docker': + if version_format in ('npm','docker'i): return "{}-{}.{}".format(next_version,branch.replace('/','-'),build) if version_format == 'maven': qualifier = 'SNAPSHOT' if build == 0 else build diff --git a/semver/tests.py b/semver/tests.py index 826029e..ab28526 100644 --- a/semver/tests.py +++ b/semver/tests.py @@ -69,7 +69,7 @@ class TestGetVersion(unittest.TestCase): def test_branch_docker_pre_release(self): create_git_environment() subprocess.call(['git', 'checkout', '-b', 'patch/branch']) - branch = get_version.get_version(build=2,version_format='npm') + branch = get_version.get_version(build=2,version_format='docker') self.assertEqual(branch, "0.0.1-patch-branch.2") def test_branch_maven_pre_release(self): create_git_environment()