Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3cf13ae

Browse filesBrowse files
committed
Lock down test_dendrogram_orientation_two spec.
1 parent f3b57fc commit 3cf13ae
Copy full SHA for 3cf13ae

File tree

Expand file treeCollapse file tree

1 file changed

+66
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+66
-6
lines changed

‎plotly/tests/test_optional/test_opt_tracefactory.py

Copy file name to clipboardExpand all lines: plotly/tests/test_optional/test_opt_tracefactory.py
+66-6Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,69 @@ def test_dendrogram_orientation_two(self):
463463
'rgb(245,245,245)'] # white smoke
464464

465465
dendro = tls.FigureFactory.create_dendrogram(X, colorscale=greyscale)
466-
self.assertEqual(dendro["data"][0]['marker']['color'],
467-
'rgb(128,128,128)')
468-
self.assertEqual(dendro["data"][1]['marker']['color'],
469-
'rgb(128,128,128)')
470-
self.assertEqual(dendro["data"][2]['marker']['color'],
471-
'rgb(0,0,0)')
466+
467+
expected_dendro = go.Figure(
468+
data=go.Data([
469+
go.Scatter(
470+
x=np.array([25., 25., 35., 35.]),
471+
y=np.array([0., 1., 1., 0.]),
472+
marker=go.Marker(color='rgb(128,128,128)'),
473+
mode='lines',
474+
xaxis='x',
475+
yaxis='y'
476+
),
477+
go.Scatter(
478+
x=np.array([15., 15., 30., 30.]),
479+
y=np.array([0., 2.23606798, 2.23606798, 1.]),
480+
marker=go.Marker(color='rgb(128,128,128)'),
481+
mode='lines',
482+
xaxis='x',
483+
yaxis='y'
484+
),
485+
go.Scatter(
486+
x=np.array([5., 5., 22.5, 22.5]),
487+
y=np.array([0., 3.60555128, 3.60555128, 2.23606798]),
488+
marker=go.Marker(color='rgb(0,0,0)'),
489+
mode='lines',
490+
xaxis='x',
491+
yaxis='y'
492+
)
493+
]),
494+
layout=go.Layout(
495+
autosize=False,
496+
height='100%',
497+
hovermode='closest',
498+
showlegend=False,
499+
width='100%',
500+
xaxis=go.XAxis(
501+
mirror='allticks',
502+
rangemode='tozero',
503+
showgrid=False,
504+
showline=True,
505+
showticklabels=True,
506+
tickmode='array',
507+
ticks='outside',
508+
ticktext=np.array(['3', '2', '0', '1']),
509+
tickvals=[5.0, 15.0, 25.0, 35.0],
510+
type='linear',
511+
zeroline=False
512+
),
513+
yaxis=go.YAxis(
514+
mirror='allticks',
515+
rangemode='tozero',
516+
showgrid=False,
517+
showline=True,
518+
showticklabels=True,
519+
ticks='outside',
520+
type='linear',
521+
zeroline=False
522+
)
523+
)
524+
)
525+
526+
self.assertEqual(len(dendro['data']), 3)
527+
528+
# this is actually a bit clearer when debugging tests.
529+
self.assert_dict_equal(dendro['data'][0], expected_dendro['data'][0])
530+
self.assert_dict_equal(dendro['data'][1], expected_dendro['data'][1])
531+
self.assert_dict_equal(dendro['data'][2], expected_dendro['data'][2])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.