Пример #1
0
    def when_no_message():
        msg = common.style("", _color_support=True)

        expect(msg) == ""
Пример #2
0
    def when_no_color_support():
        msg = common.style("_foo_")

        expect(msg) == "_foo_"
Пример #3
0
    def when_color():
        msg = common.style("_foo_", 'message', _color_support=True)

        expect(msg) == "\x1b[1m\x1b[37m_foo_\x1b[0m"
Пример #4
0
 def when_unknown_color():
     with expect.raises(AssertionError):
         common.style("_foo_", 'bar', _color_support=True)
Пример #5
0
    def when_shell():
        msg = common.style("$ _foo_", 'shell', _color_support=True)

        expect(msg) == "\x1b[1m\x1b[32m$ \x1b[0m_foo_"