Skip to content

Commit

Permalink
Added a test for colorscales specified as a string
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ivirshup committed Aug 2, 2018
1 parent d670bb0 commit 156bb2c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ def test_present_colorscale(self):
# Presented as tuple of tuples
self.assertEqual(self.scatter.marker.colorscale,
((0, 'red'), (1, 'green')))

def test_present_colorscale_str(self):
self.assertIsNone(self.scatter.marker.colorscale)

# Assign string
self.scatter.marker.colorscale = "Viridis"

# Presented as a string
self.assertEqual(self.scatter.marker.colorscale,
"Viridis")


class TestPropertyIterContains(TestCase):
Expand Down

0 comments on commit 156bb2c

Please sign in to comment.