Fix cli that would play all scripts
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import pytest
|
||||
from shlax import Output
|
||||
|
||||
|
||||
class Write:
|
||||
def __init__(self):
|
||||
self.output = ''
|
||||
def __call__(self, out):
|
||||
self.output += out.decode('utf8')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def write():
|
||||
return Write()
|
||||
|
||||
|
||||
def test_output_regexps(write):
|
||||
output = Output(
|
||||
regexps={'.*': {0: 0}},
|
||||
write=write,
|
||||
flush=lambda: None,
|
||||
)
|
||||
output('foo')
|
||||
assert write.output == output.colorize(0, 'foo')
|
||||
Reference in New Issue
Block a user