@@ -15,35 +15,40 @@ def setUp(self):
1515 def test_update_dict (self ):
1616 title = 'this'
1717 fig = Figure ()
18- fig .update (layout = Layout (title = title ))
18+ update_res1 = fig .update (layout = Layout (title = title ))
1919 assert fig == Figure (layout = Layout (title = title ))
20- fig ['layout' ].update (xaxis = XAxis ())
20+ update_res2 = fig ['layout' ].update (xaxis = XAxis ())
2121 assert fig == Figure (layout = Layout (title = title , xaxis = XAxis ()))
22+ assert update_res1 is fig
23+ assert update_res2 is fig .layout
2224
2325
2426 def test_update_list (self ):
2527 trace1 = Scatter (x = [1 , 2 , 3 ], y = [2 , 1 , 2 ])
2628 trace2 = Scatter (x = [1 , 2 , 3 ], y = [3 , 2 , 1 ])
2729 fig = Figure ([trace1 , trace2 ])
2830 update = dict (x = [2 , 3 , 4 ], y = [1 , 2 , 3 ])
29- fig .data [0 ].update (update )
30- fig .data [1 ].update (update )
31+ update_res1 = fig .data [0 ].update (update )
32+ update_res2 = fig .data [1 ].update (update )
3133
3234 d1 , d2 = strip_dict_params (fig .data [0 ], Scatter (x = [2 , 3 , 4 ], y = [1 , 2 , 3 ]))
3335 assert d1 == d2
3436 d1 , d2 = strip_dict_params (fig .data [1 ], Scatter (x = [2 , 3 , 4 ], y = [1 , 2 , 3 ]))
3537 assert d1 == d2
38+ assert update_res1 is fig .data [0 ]
39+ assert update_res2 is fig .data [1 ]
3640
3741
3842 def test_update_dict_empty (self ):
3943 trace1 = Scatter (x = [1 , 2 , 3 ], y = [2 , 1 , 2 ])
4044 trace2 = Scatter (x = [1 , 2 , 3 ], y = [3 , 2 , 1 ])
4145 fig = Figure ([trace1 , trace2 ])
42- fig .update ({})
46+ update_res = fig .update ({})
4347 d1 , d2 = strip_dict_params (fig .data [0 ], Scatter (x = [1 , 2 , 3 ], y = [2 , 1 , 2 ]))
4448 assert d1 == d2
4549 d1 , d2 = strip_dict_params (fig .data [1 ], Scatter (x = [1 , 2 , 3 ], y = [3 , 2 , 1 ]))
4650 assert d1 == d2
51+ assert update_res is fig
4752
4853
4954 def test_update_list_empty (self ):
0 commit comments