From 54dabe601eaa19d0495d9a102b34e9daa056457d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Oct 2019 17:19:34 +0100 Subject: new/additional GWB CDX filter scripts --- pig/tests/test_filter_software.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pig/tests/test_filter_software.py (limited to 'pig/tests/test_filter_software.py') 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 + -- cgit v1.2.3