diff options
author | Bryan Newbold <bnewbold@archive.org> | 2019-12-22 14:21:25 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2019-12-22 14:21:25 -0800 |
commit | 990f28b283bce4a524b4e32178f45e40214ee0de (patch) | |
tree | e9bceaa3ceeda3668db6a73f75b1305270693857 /pig/tests/pighelper.py | |
parent | cbe1af25bdfefd5a6bd9da6014440eaf88ee8e26 (diff) | |
download | sandcrawler-990f28b283bce4a524b4e32178f45e40214ee0de.tar.gz sandcrawler-990f28b283bce4a524b4e32178f45e40214ee0de.zip |
pig: move count_lines helper to pighelper.py
Diffstat (limited to 'pig/tests/pighelper.py')
-rw-r--r-- | pig/tests/pighelper.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pig/tests/pighelper.py b/pig/tests/pighelper.py index 4aa4259..95e0426 100644 --- a/pig/tests/pighelper.py +++ b/pig/tests/pighelper.py @@ -17,6 +17,9 @@ import unittest import subprocess +def count_lines(s): + return len([l for l in s.strip().split('\n') if len(l) > 0]) + class PigTestHelper(unittest.TestCase): @classmethod @@ -50,7 +53,7 @@ class PigTestHelper(unittest.TestCase): return retval def run_pig(self, script_path, in_file, **kwargs): - """Convenience helper around run_pig(). + """Convenience helper around run_pig_raw(). INPUT parameter is set to in_file. OUTPUT parameter is set to a random file. |