示例#1
0
    def test_runner(self, tmpdir, fname, content, output):
        f = tmpdir.join(fname)
        f.write(content)

        stage = Stage(f)

        assert stage._runner() == output
示例#2
0
    def test_process(self, tmpdir):
        f = tmpdir.join('test.py')
        f.write(dedent('''
            from __future__ import print_function
            import sys
            
            for line in sys.stdin.readlines():
                print(line)
        '''))

        lines = [
            {'a': 'b'},
            {'b': 'c'},
            {'c': 'd'},
        ]

        stage = Stage(f)

        assert stage.process(lines) == lines