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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Jun 2019 21:24:21 +0000 (17:24 -0400)
commit4a5ca9689009b1defd6f4e265ac92f89d6f9d90b
treed045fd07ce0c92e6b220522593e8f32acc7e3ed6
parent27d97a3f0002289edadd0b9c4a4f9d4b1b667569
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.026579 seconds and 4 git commands to generate.