summaryrefslogtreecommitdiffstats
path: root/gitlint/tests/test_display.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-04 03:31:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-04 03:31:41 +0000
commit72b8c35be4293bd21de123854491c658c53af100 (patch)
tree735464cc081879561927a37650b1102beaa1f4f9 /gitlint/tests/test_display.py
parentAdding upstream version 0.16.0. (diff)
downloadgitlint-72b8c35be4293bd21de123854491c658c53af100.tar.xz
gitlint-72b8c35be4293bd21de123854491c658c53af100.zip
Adding upstream version 0.17.0.upstream/0.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gitlint/tests/test_display.py')
-rw-r--r--gitlint/tests/test_display.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/gitlint/tests/test_display.py b/gitlint/tests/test_display.py
deleted file mode 100644
index 167ef96..0000000
--- a/gitlint/tests/test_display.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from io import StringIO
-
-from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
-
-from gitlint.display import Display
-from gitlint.config import LintConfig
-from gitlint.tests.base import BaseTestCase
-
-
-class DisplayTests(BaseTestCase):
- def test_v(self):
- display = Display(LintConfig())
- display.config.verbosity = 2
-
- with patch('gitlint.display.stderr', new=StringIO()) as stderr:
- # Non exact outputting, should output both v and vv output
- with patch('gitlint.display.stdout', new=StringIO()) as stdout:
- display.v("tëst")
- display.vv("tëst2")
- # vvvv should be ignored regardless
- display.vvv("tëst3.1")
- display.vvv("tëst3.2", exact=True)
- self.assertEqual("tëst\ntëst2\n", stdout.getvalue())
-
- # exact outputting, should only output v
- with patch('gitlint.display.stdout', new=StringIO()) as stdout:
- display.v("tëst", exact=True)
- display.vv("tëst2", exact=True)
- # vvvv should be ignored regardless
- display.vvv("tëst3.1")
- display.vvv("tëst3.2", exact=True)
- self.assertEqual("tëst2\n", stdout.getvalue())
-
- # standard error should be empty throughtout all of this
- self.assertEqual('', stderr.getvalue())
-
- def test_e(self):
- display = Display(LintConfig())
- display.config.verbosity = 2
-
- with patch('gitlint.display.stdout', new=StringIO()) as stdout:
- # Non exact outputting, should output both v and vv output
- with patch('gitlint.display.stderr', new=StringIO()) as stderr:
- display.e("tëst")
- display.ee("tëst2")
- # vvvv should be ignored regardless
- display.eee("tëst3.1")
- display.eee("tëst3.2", exact=True)
- self.assertEqual("tëst\ntëst2\n", stderr.getvalue())
-
- # exact outputting, should only output v
- with patch('gitlint.display.stderr', new=StringIO()) as stderr:
- display.e("tëst", exact=True)
- display.ee("tëst2", exact=True)
- # vvvv should be ignored regardless
- display.eee("tëst3.1")
- display.eee("tëst3.2", exact=True)
- self.assertEqual("tëst2\n", stderr.getvalue())
-
- # standard output should be empty throughtout all of this
- self.assertEqual('', stdout.getvalue())