@@ -38,7 +38,7 @@ def test_deepcopy_figure(fig1):
38
38
fig_copied = copy .deepcopy (fig1 )
39
39
40
40
# Contents should be equal
41
- assert pio . to_json ( fig_copied ) == pio . to_json ( fig1 )
41
+ assert fig_copied . to_dict ( ) == fig1 . to_dict ( )
42
42
43
43
# Identities should be distinct
44
44
assert fig_copied is not fig1
@@ -50,7 +50,7 @@ def test_deepcopy_figure_subplots(fig_subplots):
50
50
fig_copied = copy .deepcopy (fig_subplots )
51
51
52
52
# Contents should be equal
53
- assert pio . to_json ( fig_copied ) == pio . to_json ( fig_subplots )
53
+ assert fig_copied . to_dict ( ) == fig_subplots . to_dict ( )
54
54
55
55
# Subplot metadata should be equal
56
56
assert fig_subplots ._grid_ref == fig_copied ._grid_ref
@@ -66,7 +66,7 @@ def test_deepcopy_figure_subplots(fig_subplots):
66
66
fig_copied .add_bar (y = [0 , 0 , 1 ], row = 1 , col = 2 )
67
67
68
68
# And contents should be still equal
69
- assert pio . to_json ( fig_copied ) == pio . to_json ( fig_subplots )
69
+ assert fig_copied . to_dict ( ) == fig_subplots . to_dict ( )
70
70
71
71
72
72
def test_deepcopy_layout (fig1 ):
@@ -91,21 +91,21 @@ def test_pickle_figure_round_trip(fig1):
91
91
fig_copied = pickle .loads (pickle .dumps (fig1 ))
92
92
93
93
# Contents should be equal
94
- assert pio . to_json ( fig_copied ) == pio . to_json ( fig1 )
94
+ assert fig_copied . to_dict ( ) == fig1 . to_dict ( )
95
95
96
96
97
97
def test_pickle_figure_subplots_round_trip (fig_subplots ):
98
98
fig_copied = pickle .loads (pickle .dumps (fig_subplots ))
99
99
100
100
# Contents should be equal
101
- assert pio . to_json ( fig_copied ) == pio . to_json ( fig_subplots )
101
+ assert fig_copied . to_dict ( ) == fig_subplots . to_dict ( )
102
102
103
103
# Should be possible to add new trace to subplot location
104
104
fig_subplots .add_bar (y = [0 , 0 , 1 ], row = 1 , col = 2 )
105
105
fig_copied .add_bar (y = [0 , 0 , 1 ], row = 1 , col = 2 )
106
106
107
107
# And contents should be still equal
108
- assert pio . to_json ( fig_copied ) == pio . to_json ( fig_subplots )
108
+ assert fig_copied . to_dict ( ) == fig_subplots . to_dict ( )
109
109
110
110
111
111
def test_pickle_layout (fig1 ):
0 commit comments