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/.
11 from mozterm
import NullTerminal
, Terminal
15 blessed
= pytest
.importorskip("blessed")
17 assert isinstance(term
, blessed
.Terminal
)
19 term
= Terminal(disable_styling
=True)
20 assert isinstance(term
, NullTerminal
)
23 def test_null_terminal():
25 assert term
.red("foo") == "foo"
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__":