bt2: Adapt test_clock_class.py and make it pass
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 3 Jun 2019 22:41:45 +0000 (18:41 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 5 Jun 2019 17:47:34 +0000 (13:47 -0400)
commitbe7bbff934d18e407853436dd9f7da23c8c20743
treee463b8a0eebaf1bd6f163e4ebc5677dcd58754f4
parent2ae9f48c88d9359f2b2bf1cbac3c6dab5a22cfbb
bt2: Adapt test_clock_class.py and make it pass

This patch adapts test_clock_class to the current BT API and changes
what's needed to make it pass.

One change in test_clock_class is that clock classes need to be created
from self components now, so it requires a bit more boilerplate.

Everthing related to equality, copy and deepcopy is removed from
ClockClass.  However, it remains possible to test a _ClockSnapshot for
equality against an integer.  I thoough it would be useful to support
other relational operations (<, <=, >, >=) for clock snapshots, so I
added support for them using functools.total_ordering.

The constructors for both _ClockSnapshot and ClockClass are removed, as
the user never directly creates those objects anymore.  Clock snapshots
are obtained from messages, while clock classes are created using the
_create_clock_class method of a component.

As in previous patches, the public setters are removed, as we only
support setting properies when creating an object.

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