Skip to content

Commit

Permalink
Add test of dot radius fallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Oct 9, 2024
1 parent 3dd2907 commit 272f20c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion glue_plotly/common/tests/test_dotplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from glue_qt.viewers.histogram import HistogramViewer

from glue_plotly.common import sanitize
from glue_plotly.common.dotplot import traces_for_layer
from glue_plotly.common.dotplot import dot_radius, traces_for_layer

from glue_plotly.viewers.histogram.viewer import PlotlyHistogramView
from glue_plotly.viewers.histogram.dotplot_layer_artist import PlotlyDotplotLayerArtist
Expand Down Expand Up @@ -76,3 +76,15 @@ def test_basic_dots(self):

assert dots.y == expected_y
assert dots.marker.size == 16 # Default figure is 640x480

def test_dot_radius_defined(self):
"""
This test makes sure that we correctly get the default value for the dot radius
when both axes have no range.
"""
self.viewer.state.x_min = 1
self.viewer.state.x_max = 1
self.viewer.state.y_min = 1
self.viewer.state.y_max = 1

assert dot_radius(self.viewer, self.layer.state) == 0.5

0 comments on commit 272f20c

Please sign in to comment.