示例#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_"