예제 #1
0
파일: test_utils.py 프로젝트: talpay/sacred
def test_apply_backspaces_and_linefeeds(text, expected):
    assert apply_backspaces_and_linefeeds(text) == expected
 def __call__(self, text):
     text = apply_backspaces_and_linefeeds(text)
     lines = text.split('\n')
     lines_filtered = [l for l in lines if not l.startswith(self.prefix)]
     return '\n'.join(lines_filtered)
예제 #3
0
def test_apply_backspaces_and_linefeeds(text, expected):
    assert apply_backspaces_and_linefeeds(text) == expected
import sys
from sacred.utils import apply_backspaces_and_linefeeds

with open(sys.argv[1], 'r') as input, open(sys.argv[2], 'w') as output:
    output.write(apply_backspaces_and_linefeeds(input.read()))