Skip to content

Commit 8281bf3

Browse files
committed
Test the petl executable
1 parent 1e77626 commit 8281bf3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

petl/test/test_executable.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from __future__ import print_function, division, absolute_import
2+
3+
import subprocess
4+
5+
def test_executable():
6+
result = subprocess.run("""
7+
(echo foo,bar ; echo a,b; echo c,d) |
8+
petl 'fromcsv().cut("foo").head(1).tocsv()'
9+
""", shell=True, check=True, capture_output=True)
10+
assert result.stdout == b'foo\r\na\r\n'

0 commit comments

Comments
 (0)