File: test_cli.py

package info (click to toggle)
git-delete-merged-branches 7.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 300 kB
  • sloc: python: 1,843; sh: 26; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 512 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Copyright (C) 2020 Sebastian Pipping <sebastian@pipping.org>
# Licensed under GPL v3 or later

import sys
from io import StringIO
from unittest import TestCase
from unittest.mock import patch

from .._cli import _parse_command_line


class HelpOutputTest(TestCase):
    def test_help(self):
        with patch.object(sys, "stdout", StringIO()) as mock_stdout, self.assertRaises(SystemExit):
            _parse_command_line(colorize=True, args=["--help"])
        self.assertIn("usage", mock_stdout.getvalue())