| 46 | |
| 47 | |
| 48 | def test_deepcopy_figure_subplots(fig_subplots): |
| 49 | fig_copied = copy.deepcopy(fig_subplots) |
| 50 | |
| 51 | # Contents should be equal |
| 52 | assert fig_copied.to_dict() == fig_subplots.to_dict() |
| 53 | |
| 54 | # Subplot metadata should be equal |
| 55 | assert fig_subplots._grid_ref == fig_copied._grid_ref |
| 56 | assert fig_subplots._grid_str == fig_copied._grid_str |
| 57 | |
| 58 | # Identities should be distinct |
| 59 | assert fig_copied is not fig_subplots |
| 60 | assert fig_copied.layout is not fig_subplots.layout |
| 61 | assert fig_copied.data is not fig_subplots.data |
| 62 | |
| 63 | # Should be possible to add new trace to subplot location |
| 64 | fig_subplots.add_bar(y=[0, 0, 1], row=1, col=2) |
| 65 | fig_copied.add_bar(y=[0, 0, 1], row=1, col=2) |
| 66 | |
| 67 | # And contents should be still equal |
| 68 | assert fig_copied.to_dict() == fig_subplots.to_dict() |
| 69 | |
| 70 | |
| 71 | def test_deepcopy_layout(fig1): |