4 Test: grep input bags to HTML output.
6 ------------------------------------------------------------------------------
7 This file is part of grepros - grep for ROS bag files and live topics.
8 Released under the BSD License.
13 ------------------------------------------------------------------------------
20 sys.path.insert(0, os.path.join(os.path.dirname(__file__),
".."))
21 from test
import testbase
23 logger = logging.getLogger()
27 """Tests grepping from input bags and writing matches to HTML file."""
30 NAME = os.path.splitext(os.path.basename(__file__))[0]
36 OUTPUT_SUFFIX =
".html"
39 """Collects bags in data directory, assembles command."""
44 """Runs grepros on bags in data directory, verifies HTML output."""
47 self.assertTrue(os.path.isfile(self.
_outname),
"Expected output file not written.")
49 logger.info(
"Reading data from written %s.", self.
OUTPUT_LABEL)
50 texts, parser = [], html.parser.HTMLParser()
51 parser.handle_data = texts.append
54 fulltext =
"".join(texts)
58 if "__main__" == __name__:
59 TestBagInputHtmlOutput.run_rostest()