Skip to content
Snippets Groups Projects
Commit 39f2b1ed authored by leufen1's avatar leufen1
Browse files

coverage is now 100%, /close #243

parent c60b26d2
No related branches found
No related tags found
3 merge requests!226Develop,!225Resolve "release v1.2.0",!224Resolve "new tests for tracker plot"
Pipeline #55666 passed
This commit is part of merge request !225. Comments created here will be created in the context of that merge request.
......@@ -119,11 +119,13 @@ class TrackChain:
control_obj = control[variable][scope]
if method == "set":
track_objects = self._add_set_object(track_objects, tr, control_obj)
elif method == "get":
elif method == "get": # pragma: no branch
track_objects, skip_control_update = self._add_get_object(track_objects, tr, control_obj,
control, scope, variable)
if skip_control_update is True:
continue
else: # pragma: no cover
raise ValueError(f"method must be either set or get but given was {method}.")
self._update_control(control, variable, scope, tr)
return track_objects, control
......
......@@ -392,20 +392,18 @@ class TestTrackPlot:
track_plot_obj.rect(x=4, y=2)
assert len(track_plot_obj.ax.artists) == 1
assert len(track_plot_obj.ax.texts) == 1
track_plot_obj.ax.artists[0].xy == (4, 2)
track_plot_obj.ax.artists[0]._height == h
track_plot_obj.ax.artists[0]._width == w
track_plot_obj.ax.artists[0]._original_facecolor == "orange"
track_plot_obj.ax.texts[0].xy == (4 + w / 2, 2 + h / 2)
track_plot_obj.ax.texts[0]._color == "w"
track_plot_obj.ax.texts[0]._text == "get"
assert track_plot_obj.ax.artists[0].xy == (4, 2)
assert track_plot_obj.ax.artists[0]._height == h
assert track_plot_obj.ax.artists[0]._width == w
assert track_plot_obj.ax.artists[0]._original_facecolor == "orange"
assert track_plot_obj.ax.texts[0].xy == (4 + w / 2, 2 + h / 2)
assert track_plot_obj.ax.texts[0]._color == "w"
assert track_plot_obj.ax.texts[0]._text == "get"
track_plot_obj.rect(x=4, y=2, method="set")
assert len(track_plot_obj.ax.artists) == 2
assert len(track_plot_obj.ax.texts) == 2
track_plot_obj.ax.artists[0]._original_facecolor == "lightblue"
track_plot_obj.ax.texts[0]._text == "set"
assert track_plot_obj.ax.artists[1]._original_facecolor == "lightblue"
assert track_plot_obj.ax.texts[1]._text == "set"
def test_set_ypos_anchor(self, track_plot_obj, scopes, dims):
assert not hasattr(track_plot_obj, "y_pos")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment