Skip to content

Commit 7a609a7

Browse files
committed
Add test
1 parent 2eec7ce commit 7a609a7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_core/test_graph_objs/test_figure_properties.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from unittest import TestCase
2+
from unittest.mock import MagicMock
23
import pytest
34

45
import plotly.graph_objs as go
@@ -42,6 +43,15 @@ def test_contains(self):
4243
def test_iter(self):
4344
self.assertEqual(set(self.figure), {"data", "layout", "frames"})
4445

46+
def test_unsupported_eq_returns_not_implemented(self):
47+
other = MagicMock()
48+
self.assertFalse(self.figure == other)
49+
other.__eq__.assert_called_once_with(self.figure)
50+
51+
other.reset_mock()
52+
self.assertFalse(self.figure.layout == other)
53+
other.__eq__.assert_called_once_with(self.figure.layout)
54+
4555
def test_attr_item(self):
4656
# test that equal objects can be retrieved using attr or item
4757
# syntax

0 commit comments

Comments
 (0)