bt2: refactor test_message_iterator
authorSimon Marchi <simon.marchi@efficios.com>
Sun, 8 Sep 2019 21:26:09 +0000 (17:26 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 17 Sep 2019 19:05:53 +0000 (15:05 -0400)
commit0a6d7302f774fbd35d7439889734acd418e8ef14
treef178034f7abc120de6ffcb8367376df179f063df
parent5679964cffc1ecbb1b7d4fbd6a5ab9f3a7832bba
bt2: refactor test_message_iterator

This patch tries to make test_message_iterator a bit easier to
understand and extend, since the following patches add various tests in
it.

- Split the test class in two, with "seek beginning" tests in their own
  class.
- Rename _setup_seek_beginning_test to _setup_seek_test, as we'll use it
  for seek ns from origin tests.
- Move _create_graph and _setup_seek_test to be top-level
  functions, they don't really benefit from being static methods.  Plus,
  we'll want to share them between the different test classes.
- Make _setup_seek_test take parameters for various optional methods to
  add to the message iterator class (for now, _user_seek_beginning and
  _user_can_seek_beginning).
- Make _setup_seek_test use _create_graph.
- Split test `test_can_seek_beginning` in three: one for when we have
  a _user_can_seek_beginning method, one for when we don't but have a
  _user_seek_beginning method, and the other one for when we have none
  of those.

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