bt2: test_message_iterator: use assertIs instead of assertTrue/assertFalse in can...
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 9 Sep 2019 18:04:19 +0000 (14:04 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 14:45:10 +0000 (10:45 -0400)
commita564cdf486b1b5fae178933e66ea6fd0dd634412
treeb18f094c0660b701232633d3dcb17912196332a6
parenta43da05ae0b3b6d19bff73f21917b89b92f1a4a8
bt2: test_message_iterator: use assertIs instead of assertTrue/assertFalse in can seek tests

In these tests, we want to specifically check that the return values are
True or False, not any value that evaluates to True or False.

For example, we initialize can_seek_beginning to None, run
graph.run_once(), then do assertFalse(can_seek_beginning).  If, for some
reason, can_seek_beginning is still None, the test will wrongfully pass.

The same could happen if can_seek_beginning gets assigned some value
that evaluates to True (other than True itself) and we use
assertTrue(can_seek_beginning).

Instead, use assertIs, which checks that the value is specifically the
one and only True or the one and only False.

Change-Id: Idf94d350ecc06cdb6a38ca31b2d77804fbf57df7
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2019
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/bindings/python/bt2/test_message_iterator.py
This page took 0.024222 seconds and 4 git commands to generate.