Skip to content

Commit

Permalink
test(version): allow version to be 'UNRELEASED' or SemVer
Browse files Browse the repository at this point in the history
During test build: 'UNRELEASED'
During release build: e.g. '1.0.0'
  • Loading branch information
christiansiegel committed Apr 21, 2020
1 parent 9927f6f commit 09552f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/commands/test_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
import sys
import unittest
from contextlib import contextmanager
Expand All @@ -22,7 +23,7 @@ class VersionCommandTest(unittest.TestCase):
def test_output(self):
with captured_output() as stdout:
version_command("version")
self.assertEqual("GitOps CLI version UNRELEASED\n", stdout.getvalue())
assert re.match(r"^GitOps CLI version (?:\d+\.\d+\.\d+|UNRELEASED)\n$", stdout.getvalue())

def test_wrong_command_arg(self):
with pytest.raises(AssertionError):
Expand Down

0 comments on commit 09552f0

Please sign in to comment.