Test that the --version option returns something

With the transition from pkg_resources to importlib.metadata,
finding the version string has become more complicated. Test it so
we don't break it in the future.

Change-Id: I20526518ab75ac7b58869d4126c4b5b2bc0df541
This commit is contained in:
Jeremy Stanley 2024-03-04 23:28:19 +00:00
parent 7b823c16e2
commit 47c4096f06
1 changed files with 5 additions and 0 deletions

View File

@ -70,6 +70,11 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
self.assertIn('test commit message [NEW]', gr)
self.assertIn('Change-Id:', self._run_git('log', '-1'))
def test_git_review_version(self):
"""Test git-review --version."""
self.assertTrue(
self._run_git_review('--version').startswith('git-review version'))
def test_git_review_s(self):
"""Test git-review -s."""
self.reset_remote()