diff options
author | Bryan Newbold <bnewbold@archive.org> | 2019-10-17 17:19:34 +0100 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2019-10-17 17:19:34 +0100 |
commit | 54dabe601eaa19d0495d9a102b34e9daa056457d (patch) | |
tree | 392e3ba4fa6a6c9d4fdda2de0e7b4656ead18f83 /pig/tests/test_filter_software.py | |
parent | 04e1ae4f903af98ef174be9110aaae5e1ab81360 (diff) | |
download | sandcrawler-54dabe601eaa19d0495d9a102b34e9daa056457d.tar.gz sandcrawler-54dabe601eaa19d0495d9a102b34e9daa056457d.zip |
new/additional GWB CDX filter scripts
Diffstat (limited to 'pig/tests/test_filter_software.py')
-rw-r--r-- | pig/tests/test_filter_software.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pig/tests/test_filter_software.py b/pig/tests/test_filter_software.py new file mode 100644 index 0000000..f0ea1b6 --- /dev/null +++ b/pig/tests/test_filter_software.py @@ -0,0 +1,18 @@ + +import os +import unittest +from pighelper import PigTestHelper + +def count_lines(s): + return len([l for l in s.strip().split('\n') if len(l) > 0]) + +class TestFilterCDXSoftware(PigTestHelper): + + def test_tarballs(self): + r = self.run_pig("filter-cdx-tarball.pig", "tests/files/tarballs.cdx") + assert count_lines(r) == 2 + + def test_source_code(self): + r = self.run_pig("filter-cdx-source-code-crude.pig", "tests/files/sourcecode.cdx") + assert count_lines(r) == 1 + |