diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-05-08 06:21:29 +0000 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-05-08 06:21:29 +0000 |
commit | e566ee1b4e134bfc06284cf77d8d1370df30d53f (patch) | |
tree | f3969054cc5f93608b5c72d41541ea381ef89a6b /pig/tests/pighelper.py | |
parent | 0c398392aa298d28694bf5bd37d3e4912de8a2f5 (diff) | |
parent | 65b7d45852af3de557eaaf200471ff9b1a211970 (diff) | |
download | sandcrawler-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.py | 14 |
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 |