Skip to content

Commit adf3e2e

Browse files
committed
Added quick test for update_settings_from method
1 parent 3adf325 commit adf3e2e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

glue/viewers/matplotlib/qt/tests/test_data_viewer.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from glue.core.roi import XRangeROI
1717
from glue.utils.qt import process_events
1818
from glue.tests.helpers import requires_matplotlib_ge_22
19+
from glue.viewers.matplotlib.state import MatplotlibDataViewerState
1920

2021

2122
class MatplotlibDrawCounter(object):
@@ -620,3 +621,26 @@ def test_hide_axes(self):
620621

621622
self.viewer.state.show_axes = True
622623
assert self.viewer.axes.axison
624+
625+
def test_update_settings_from(self):
626+
copy_from_state = MatplotlibDataViewerState()
627+
copy_from_state.x_axislabel_size = 1
628+
copy_from_state.y_axislabel_size = 2
629+
copy_from_state.x_axislabel_weight = 'heavy'
630+
copy_from_state.y_axislabel_weight = 'black'
631+
copy_from_state.x_ticklabel_size = 5
632+
copy_from_state.y_ticklabel_size = 6
633+
copy_from_state.show_axes = False
634+
state = self.viewer.state
635+
state.update_axes_settings_from(copy_from_state)
636+
assert state.x_axislabel_size == 1
637+
assert state.y_axislabel_size == 2
638+
assert state.x_axislabel_weight == 'heavy'
639+
assert state.y_axislabel_weight == 'black'
640+
assert state.x_ticklabel_size == 5
641+
assert state.y_ticklabel_size == 6
642+
assert not state.show_axes
643+
644+
645+
646+

0 commit comments

Comments
 (0)