This is a useful piece of functionality to being able to eat URL hyperlinks, for instance, which is a bug that Lix has while dealing with terminal output today. Change-Id: I77b2de107b2525cad7ea5dea28bfba2cc78b9e6d
9 lines
314 B
Python
9 lines
314 B
Python
from functional2.testlib.terminal_code_eater import eat_terminal_codes
|
|
|
|
|
|
def test_eats_color():
|
|
assert eat_terminal_codes(b'\x1b[7mfoo blah bar\x1b[0m') == b'foo blah bar'
|
|
|
|
def test_eats_osc():
|
|
assert eat_terminal_codes(b'\x1b]8;;http://example.com\x1b\\This is a link\x1b]8;;\x1b\\') == b'This is a link'
|