Skip to content

Commit

Permalink
Update tests for pontos --version
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernricks committed May 4, 2023
1 parent 6341ead commit 99c4341
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_pontos.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
from unittest.mock import patch

from pontos import main
from pontos.version import __version__


class TestPontos(unittest.TestCase):
@patch("pontos.pontos.ConsoleTerminal")
@patch("pontos.pontos.RichTerminal")
def test_pontos(self, terminal_mock):
main()

Expand All @@ -35,3 +36,12 @@ def test_pontos(self, terminal_mock):
'Use the listed commands "help" for more information '
"and arguments description."
)

@patch("pontos.pontos.RichTerminal")
@patch("sys.argv", ["pontos", "--version"])
def test_pontos_version(self, terminal_mock):
main()

terminal_mock.return_value.print.assert_called_once_with(
f"pontos version {__version__}"
)

0 comments on commit 99c4341

Please sign in to comment.