Bug 1845017 - Disable the TestPHCExhaustion test r=glandium
[gecko.git] / python / mozterm / test / test_terminal.py
bloba24dd01ba4e0a7fc7b02ad69e6c81f8e0acc979d
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 import os
6 import sys
8 import mozunit
9 import pytest
11 from mozterm import NullTerminal, Terminal
14 def test_terminal():
15 blessed = pytest.importorskip("blessed")
16 term = Terminal()
17 assert isinstance(term, blessed.Terminal)
19 term = Terminal(disable_styling=True)
20 assert isinstance(term, NullTerminal)
23 def test_null_terminal():
24 term = NullTerminal()
25 assert term.red("foo") == "foo"
26 assert term.red == ""
27 assert term.color(1) == ""
28 assert term.number_of_colors == 0
29 assert term.width == 0
30 assert term.height == 0
31 assert term.is_a_tty == os.isatty(sys.stdout.fileno())
34 if __name__ == "__main__":
35 mozunit.main()