Fix cli that would play all scripts

This commit is contained in:
jpic
2020-02-15 13:51:32 +01:00
parent 1ceee0dee6
commit 638f0fa690
12 changed files with 163 additions and 44 deletions
+24
View File
@@ -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')