aboutsummaryrefslogtreecommitdiffstats
path: root/pig/tests/test_filter_cdx.py
blob: f46e5e12a9bda60ccfa14b185c85ff05ff301be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

"""
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")