Public Member Functions | |
def | __init__ (self, *args, **kwargs) |
def | create_publisher (self, topic, cls) |
def | init_node (self) |
def | run_command (self, communicate=True) |
def | run_rostest (cls) |
def | setUp (self) |
def | shutdown_node (self) |
def | spin_once (self, timeout) |
def | subTest (self, msg=None, **params) |
def | tearDown (self) |
def | verify_bags (self) |
def | verify_topics (self, topics, messages=None) |
Public Attributes | |
maxDiff | |
Static Public Attributes | |
string | BAG_SUFFIX = "1" else ".db3" |
ROS bagfile extension. More... | |
list | CMD_BASE = ["grepros"] + SEARCH_WORDS + \ |
Base command for running grepros. More... | |
DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) | |
Test bags directory. More... | |
list | EXPECTED_TOPIC_BASES = ["/match/this/intarray", "/match/this/header"] |
Topics expected in output, bag name appended. More... | |
list | EXPECTED_WORDS = ["match_this"] |
Words expected in matched messages, bag name appended. More... | |
string | INPUT_LABEL = "ROS bags" |
Name used in flow logging. More... | |
string | NAME = "" |
Test name used in flow logging. More... | |
string | OUTPUT_LABEL = "" |
Name used in flow logging. More... | |
OUTPUT_SUFFIX = None | |
Suffix for write output file, if any. More... | |
list | SEARCH_WORDS = ["this"] |
Words searched in bag. More... | |
list | SKIPPED_TOPIC_BASES = ["/not/this/intarray", "/match/this/not"] |
Topics not expected in output, bag name appended. More... | |
list | SKIPPED_WORDS = ["not_this"] |
Words not expected in matched messages, bag name appended. More... | |
Private Attributes | |
_bags | |
_cmd | |
_node | |
_outfile | |
_outname | |
_proc | |
Tests grepping from a source to a sink, with prepared test bags.
Definition at line 46 of file testbase.py.
def test.testbase.TestBase.__init__ | ( | self, | |
* | args, | ||
** | kwargs | ||
) |
Reimplemented in test.test_library.TestLibrary, test.test_live_to_console.TestLiveInputConsoleOutput, and test.test_bag_to_live.TestBagInputLiveOutput.
Definition at line 89 of file testbase.py.
def test.testbase.TestBase.create_publisher | ( | self, | |
topic, | |||
cls | |||
) |
Definition at line 131 of file testbase.py.
def test.testbase.TestBase.init_node | ( | self | ) |
Creates ROS1 or ROS2 node.
Definition at line 137 of file testbase.py.
def test.testbase.TestBase.run_command | ( | self, | |
communicate = True |
|||
) |
Executes test command, returns command output text if communicate.
Definition at line 154 of file testbase.py.
def test.testbase.TestBase.run_rostest | ( | cls | ) |
Runs rostest if ROS1.
Definition at line 199 of file testbase.py.
def test.testbase.TestBase.setUp | ( | self | ) |
Collects bags in data directory, assembles command.
Reimplemented in test.test_library.TestLibrary, test.test_live_to_console.TestLiveInputConsoleOutput, test.test_bag_to_live.TestBagInputLiveOutput, test.test_bag_to_csv.TestBagInputCsvOutput, test.test_bag_to_html.TestBagInputHtmlOutput, test.test_bag_to_sqlite.TestBagInputSqliteOutput, test.test_bag_to_bag.TestBagInputBagOutput, test.test_bag_to_sql.TestBagInputSqlOutput, and test.test_bag_to_console.TestBagInputConsoleOutput.
Definition at line 104 of file testbase.py.
def test.testbase.TestBase.shutdown_node | ( | self | ) |
Shuts down ROS2 node, if any.
Definition at line 149 of file testbase.py.
def test.testbase.TestBase.spin_once | ( | self, | |
timeout | |||
) |
Definition at line 163 of file testbase.py.
def test.testbase.TestBase.subTest | ( | self, | |
msg = None , |
|||
** | params | ||
) |
Shim for TestCase.subTest in Py2.
Definition at line 123 of file testbase.py.
def test.testbase.TestBase.tearDown | ( | self | ) |
Terminates subprocess and deletes temporary output files, if any.
Reimplemented in test.test_library.TestLibrary, test.test_live_to_console.TestLiveInputConsoleOutput, and test.test_bag_to_csv.TestBagInputCsvOutput.
Definition at line 112 of file testbase.py.
def test.testbase.TestBase.verify_bags | ( | self | ) |
Asserts that ROS bags were found in data directory.
Definition at line 169 of file testbase.py.
def test.testbase.TestBase.verify_topics | ( | self, | |
topics, | |||
messages = None |
|||
) |
Asserts that topics and message texts were emitted as expected.
Definition at line 176 of file testbase.py.
|
private |
Definition at line 94 of file testbase.py.
|
private |
Definition at line 96 of file testbase.py.
|
private |
Definition at line 99 of file testbase.py.
|
private |
Definition at line 98 of file testbase.py.
|
private |
Definition at line 97 of file testbase.py.
|
private |
Definition at line 95 of file testbase.py.
|
static |
ROS bagfile extension.
Definition at line 65 of file testbase.py.
|
static |
Base command for running grepros.
Definition at line 71 of file testbase.py.
|
static |
Test bags directory.
Definition at line 62 of file testbase.py.
|
static |
Topics expected in output, bag name appended.
Definition at line 83 of file testbase.py.
|
static |
Words expected in matched messages, bag name appended.
Definition at line 77 of file testbase.py.
|
static |
Name used in flow logging.
Definition at line 53 of file testbase.py.
test.testbase.TestBase.maxDiff |
Definition at line 91 of file testbase.py.
|
static |
Test name used in flow logging.
Definition at line 50 of file testbase.py.
|
static |
Name used in flow logging.
Definition at line 56 of file testbase.py.
|
static |
Suffix for write output file, if any.
Definition at line 59 of file testbase.py.
|
static |
Words searched in bag.
Definition at line 68 of file testbase.py.
|
static |
Topics not expected in output, bag name appended.
Definition at line 86 of file testbase.py.
|
static |
Words not expected in matched messages, bag name appended.
Definition at line 80 of file testbase.py.