Skip to content

Commit

Permalink
Added quick test for update_settings_from method
Browse files Browse the repository at this point in the history
  • Loading branch information
jsub1 committed May 6, 2020
1 parent 3adf325 commit adf3e2e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions glue/viewers/matplotlib/qt/tests/test_data_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from glue.core.roi import XRangeROI
from glue.utils.qt import process_events
from glue.tests.helpers import requires_matplotlib_ge_22
from glue.viewers.matplotlib.state import MatplotlibDataViewerState


class MatplotlibDrawCounter(object):
Expand Down Expand Up @@ -620,3 +621,26 @@ def test_hide_axes(self):

self.viewer.state.show_axes = True
assert self.viewer.axes.axison

def test_update_settings_from(self):
copy_from_state = MatplotlibDataViewerState()
copy_from_state.x_axislabel_size = 1
copy_from_state.y_axislabel_size = 2
copy_from_state.x_axislabel_weight = 'heavy'
copy_from_state.y_axislabel_weight = 'black'
copy_from_state.x_ticklabel_size = 5
copy_from_state.y_ticklabel_size = 6
copy_from_state.show_axes = False
state = self.viewer.state
state.update_axes_settings_from(copy_from_state)
assert state.x_axislabel_size == 1
assert state.y_axislabel_size == 2
assert state.x_axislabel_weight == 'heavy'
assert state.y_axislabel_weight == 'black'
assert state.x_ticklabel_size == 5
assert state.y_ticklabel_size == 6
assert not state.show_axes




0 comments on commit adf3e2e

Please sign in to comment.