Skip to content

Commit 156bb2c

Browse files
committed
Added a test for colorscales specified as a string
Added a test checking that a colorscale specified as a string is returned as a string. Previously it had been returned as a tuple of 1-tuples. e.g. "Viridis" -> (('V',), ('i',), ('r',), ('i',), ('d',), ('i',), ('s',)). Catches plotly#1087.
1 parent d670bb0 commit 156bb2c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: plotly/tests/test_core/test_graph_objs/test_properties_validated.py

+10
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ def test_present_colorscale(self):
102102
# Presented as tuple of tuples
103103
self.assertEqual(self.scatter.marker.colorscale,
104104
((0, 'red'), (1, 'green')))
105+
106+
def test_present_colorscale_str(self):
107+
self.assertIsNone(self.scatter.marker.colorscale)
108+
109+
# Assign string
110+
self.scatter.marker.colorscale = "Viridis"
111+
112+
# Presented as a string
113+
self.assertEqual(self.scatter.marker.colorscale,
114+
"Viridis")
105115

106116

107117
class TestPropertyIterContains(TestCase):

0 commit comments

Comments
 (0)