aboutsummaryrefslogtreecommitdiffstats
path: root/pig/tests/pighelper.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2018-05-08 06:21:29 +0000
committerBryan Newbold <bnewbold@archive.org>2018-05-08 06:21:29 +0000
commite566ee1b4e134bfc06284cf77d8d1370df30d53f (patch)
treef3969054cc5f93608b5c72d41541ea381ef89a6b /pig/tests/pighelper.py
parent0c398392aa298d28694bf5bd37d3e4912de8a2f5 (diff)
parent65b7d45852af3de557eaaf200471ff9b1a211970 (diff)
downloadsandcrawler-e566ee1b4e134bfc06284cf77d8d1370df30d53f.tar.gz
sandcrawler-e566ee1b4e134bfc06284cf77d8d1370df30d53f.zip
Merge branch 'master' of git.archive.org:webgroup/sandcrawler
Diffstat (limited to 'pig/tests/pighelper.py')
-rw-r--r--pig/tests/pighelper.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/pig/tests/pighelper.py b/pig/tests/pighelper.py
index d0d89d2..4aa4259 100644
--- a/pig/tests/pighelper.py
+++ b/pig/tests/pighelper.py
@@ -36,7 +36,8 @@ class PigTestHelper(unittest.TestCase):
self._tmpdir = tempfile.mkdtemp()
def tearDown(self):
- shutil.rmtree(self._tmpdir)
+ pass
+ # XXX: shutil.rmtree(self._tmpdir)
def run_pig_raw(self, params):
"""Low-level variant with params appended directly. Returns
@@ -67,7 +68,14 @@ class PigTestHelper(unittest.TestCase):
'-p', 'INPUT={}'.format(in_file),
'-p', 'OUTPUT={}'.format(out_file),
] + pargs
- self.run_pig_raw(params)
- return out_file
+ status = self.run_pig_raw(params)
+ assert status.returncode == 0
+ # Capture all the part-r-* files
+ print("out_file: {}".format(out_file))
+ subprocess.run("/bin/ls -la {}/part-*".format(out_file), shell=True)
+ sub = subprocess.run("/bin/cat {}/part-*".format(out_file), stdout=subprocess.PIPE, shell=True)
+ out = sub.stdout.decode('utf-8')
+ print(out)
+ return out
# TODO: helper to verify that output matches an expected file