Skip to content

Commit

Permalink
Test the petl executable
Browse files Browse the repository at this point in the history
  • Loading branch information
yaniv-aknin committed May 12, 2024
1 parent 1e77626 commit 8281bf3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions petl/test/test_executable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from __future__ import print_function, division, absolute_import

import subprocess

def test_executable():
result = subprocess.run("""
(echo foo,bar ; echo a,b; echo c,d) |
petl 'fromcsv().cut("foo").head(1).tocsv()'
""", shell=True, check=True, capture_output=True)
assert result.stdout == b'foo\r\na\r\n'

0 comments on commit 8281bf3

Please sign in to comment.