test: add neither-axis-LR edge case + document swap pass-through
This commit is contained in:
@@ -193,6 +193,7 @@ def _swap_axes(
|
|||||||
new_positions[wid] = {ent: (y, x) for ent, (x, y) in pos_dict.items()}
|
new_positions[wid] = {ent: (y, x) for ent, (x, y) in pos_dict.items()}
|
||||||
|
|
||||||
new_ax = dict(axis_def)
|
new_ax = dict(axis_def)
|
||||||
|
# Non-paired keys pass through unchanged
|
||||||
# Swap paired scalar keys
|
# Swap paired scalar keys
|
||||||
new_ax["x_label"] = axis_def.get("y_label")
|
new_ax["x_label"] = axis_def.get("y_label")
|
||||||
new_ax["y_label"] = axis_def.get("x_label")
|
new_ax["y_label"] = axis_def.get("x_label")
|
||||||
|
|||||||
@@ -724,3 +724,10 @@ def test_axis_swap_not_applied_when_x_is_left_right():
|
|||||||
"y_label": "Links\u2013Rechts", # both LR — no swap
|
"y_label": "Links\u2013Rechts", # both LR — no swap
|
||||||
}
|
}
|
||||||
assert _should_swap_axes(axis_def2) is False
|
assert _should_swap_axes(axis_def2) is False
|
||||||
|
|
||||||
|
|
||||||
|
def test_axis_swap_not_applied_when_neither_axis_is_left_right():
|
||||||
|
from explorer import _should_swap_axes
|
||||||
|
|
||||||
|
assert _should_swap_axes({"x_label": "Foo", "y_label": "Bar"}) is False
|
||||||
|
assert _should_swap_axes({"x_label": None, "y_label": None}) is False
|
||||||
|
|||||||
Reference in New Issue
Block a user