Skip to content

Commit 3530fb3

Browse files
committed
add tests
1 parent 13ce57c commit 3530fb3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

emailer_lib/mjml/tests/test_core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ def test_leaf_tag_content_type_validation():
145145
MJMLTag("mj-text", content=["invalid", "list"], _is_leaf=True)
146146

147147

148+
def test_leaf_tag_attributes_type_validation():
149+
with pytest.raises(TypeError, match="attributes must be a dict or TagAttrDict"):
150+
MJMLTag("mj-text", "content", attributes="invalid", _is_leaf=True)
151+
152+
def test_container_tag_attributes_type_validation():
153+
with pytest.raises(TypeError, match="attributes must be a dict or TagAttrDict.*use positional arguments for container tags"):
154+
MJMLTag("mj-section", attributes="invalid")
155+
148156
def test_children_sequence_flattening():
149157
child1 = MJMLTag("mj-text", content="Text 1")
150158
child2 = MJMLTag("mj-text", content="Text 2")

0 commit comments

Comments
 (0)