From 719538b753423ac301e686886282695150192e47 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 30 Mar 2018 12:49:49 -0700 Subject: clean up pig test stuff --- pig/tests/pighelper.py | 5 ++--- pig/tests/test_filter_cdx.py | 33 --------------------------------- 2 files changed, 2 insertions(+), 36 deletions(-) (limited to 'pig/tests') diff --git a/pig/tests/pighelper.py b/pig/tests/pighelper.py index 3786a07..d0d89d2 100644 --- a/pig/tests/pighelper.py +++ b/pig/tests/pighelper.py @@ -5,17 +5,16 @@ Include `PigTestHelper` and extend in your test classes, call `self.run_pig()` with your script and example input file, then look at the output (at returned path) to check for validity. -TODO: squelch pig stdout going to console, presumably because of subprocess.run -behavior +TODO: switch to pytest-style fixture generation author: Bryan Newbold """ + import os import shutil import tempfile import unittest import subprocess -from nose.tools import * class PigTestHelper(unittest.TestCase): diff --git a/pig/tests/test_filter_cdx.py b/pig/tests/test_filter_cdx.py index f46e5e1..897f1f9 100644 --- a/pig/tests/test_filter_cdx.py +++ b/pig/tests/test_filter_cdx.py @@ -1,42 +1,9 @@ -""" -Abstract into a base test class/template: - -1. Needs deps downloaded and installed and env configured (bash? .env? makefile?) -2. In test, create tempdir for output. Print helpful info on every run -3. Run pig locally, inspect output files -""" - import os import unittest -from nose.tools import * from pighelper import PigTestHelper -""" -class TestFilterCDX(unittest.TestCase): - - def setUp(self): - - classpaths = [ - os.path.join("pig-0.12.0-cdh5.0.1", "pig.jar"), - os.path.join("pig-0.12.0-cdh5.0.1", "lib", "*"), - ] - - local_home = os.path.join("hadoop-2.3.0-cdh5.0.1") - - name_node = "file:///test/files" - - self.hadoop = Hadoop(local_home, name_node, classpaths) - - def test_thing(self): - - self.hadoop.run_pig_job("filter-cdx-ps.pig") - self.hadoop.copyToLocal("/reports/output.csv", "output.csv") - -""" - class TestFilterCDX(PigTestHelper): def test_thing(self): - self.run_pig("filter-cdx-ps.pig", "tests/files/example.cdx") -- cgit v1.2.3