aboutsummaryrefslogtreecommitdiffstats
path: root/pig/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2019-12-22 14:21:25 -0800
committerBryan Newbold <bnewbold@archive.org>2019-12-22 14:21:25 -0800
commit990f28b283bce4a524b4e32178f45e40214ee0de (patch)
treee9bceaa3ceeda3668db6a73f75b1305270693857 /pig/tests
parentcbe1af25bdfefd5a6bd9da6014440eaf88ee8e26 (diff)
downloadsandcrawler-990f28b283bce4a524b4e32178f45e40214ee0de.tar.gz
sandcrawler-990f28b283bce4a524b4e32178f45e40214ee0de.zip
pig: move count_lines helper to pighelper.py
Diffstat (limited to 'pig/tests')
-rw-r--r--pig/tests/pighelper.py5
-rw-r--r--pig/tests/test_filter_cdx_paper_pdfs.py4
-rw-r--r--pig/tests/test_filter_software.py4
3 files changed, 6 insertions, 7 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.
diff --git a/pig/tests/test_filter_cdx_paper_pdfs.py b/pig/tests/test_filter_cdx_paper_pdfs.py
index a8ebd9f..c2d2e6b 100644
--- a/pig/tests/test_filter_cdx_paper_pdfs.py
+++ b/pig/tests/test_filter_cdx_paper_pdfs.py
@@ -1,10 +1,8 @@
import os
import unittest
-from pighelper import PigTestHelper
+from pighelper import PigTestHelper, count_lines
-def count_lines(s):
- return len([l for l in s.strip().split('\n') if len(l) > 0])
class TestFilterCDXPaperPdfs(PigTestHelper):
diff --git a/pig/tests/test_filter_software.py b/pig/tests/test_filter_software.py
index f0ea1b6..cce90b4 100644
--- a/pig/tests/test_filter_software.py
+++ b/pig/tests/test_filter_software.py
@@ -1,10 +1,8 @@
import os
import unittest
-from pighelper import PigTestHelper
+from pighelper import PigTestHelper, count_lines
-def count_lines(s):
- return len([l for l in s.strip().split('\n') if len(l) > 0])
class TestFilterCDXSoftware(PigTestHelper):