Skip to content

Commit 4094ffc

Browse files
committed
adjust tests
1 parent ab9f2e7 commit 4094ffc

File tree

3 files changed

+5
-30
lines changed

3 files changed

+5
-30
lines changed

Diff for: packages/python/plotly/plotly/tests/test_core/test_figure_messages/test_on_change.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_multi_prop_callback_on_assignment_layout_nested(self):
9797
fn_layout = MagicMock()
9898

9999
# Register callback on change to family property under title_font
100-
self.figure.layout.xaxis.title_font.on_change(fn_title_font, "family")
100+
self.figure.layout.xaxis.title.font.on_change(fn_title_font, "family")
101101

102102
# Register callback on the range and title_font.family properties
103103
# under xaxis
@@ -106,7 +106,7 @@ def test_multi_prop_callback_on_assignment_layout_nested(self):
106106
# Register callback on xaxis object itself
107107
self.figure.layout.on_change(fn_layout, "xaxis")
108108

109-
# Assign a new xaxis range and title_font.family
109+
# Assign a new xaxis range and title.font.family
110110
self.figure.layout.xaxis.title.font.family = "courier"
111111

112112
# Check that all callbacks were executed once

Diff for: packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py

-25
Original file line numberDiff line numberDiff line change
@@ -118,31 +118,6 @@ def test_title_as_string_layout(self):
118118
{"type": "pie", "title": {"text": "A title 2", "font": {"size": 23}}},
119119
)
120120

121-
def test_legacy_title_props_remapped(self):
122-
123-
# plain Layout
124-
obj = go.Layout()
125-
self.assertIs(obj.title_font, obj.title.font)
126-
self.assertIsNone(obj.title.font.family)
127-
128-
# Set title_font in constructor
129-
obj = go.Layout(title_font={"family": "Courier"})
130-
self.assertIs(obj.title_font, obj.title.font)
131-
self.assertEqual(obj.title_font.family, "Courier")
132-
self.assertEqual(obj.title.font.family, "Courier")
133-
134-
# Property assignment
135-
obj = go.Layout()
136-
obj.title_font.family = "Courier"
137-
self.assertIs(obj.title_font, obj.title.font)
138-
self.assertEqual(obj["title_font.family"], "Courier")
139-
self.assertEqual(obj.title.font.family, "Courier")
140-
141-
# In/Iter
142-
self.assertIn("title_font", obj)
143-
self.assertIn("title_font.family", obj)
144-
self.assertIn("title_font", iter(obj))
145-
146121

147122
class TestPop(TestCase):
148123
def setUp(self):

Diff for: packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_property_assignment.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def test_toplevel_item(self):
5151
assert d1 == d2
5252

5353
def test_nested_attr(self):
54-
assert self.scatter.marker.colorbar.title_font.family is None
55-
self.scatter.marker.colorbar.title_font.family = "courier"
56-
assert self.scatter.marker.colorbar.title_font.family == "courier"
54+
assert self.scatter.marker.colorbar.title.font.family is None
55+
self.scatter.marker.colorbar.title.font.family = "courier"
56+
assert self.scatter.marker.colorbar.title.font.family == "courier"
5757
d1, d2 = strip_dict_params(self.scatter, self.expected_nested)
5858
assert d1 == d2
5959

0 commit comments

Comments
 (0)