Skip to content

Commit

Permalink
✅ tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
YousefEZ committed Dec 21, 2023
1 parent 69eff95 commit 3185043
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
14 changes: 14 additions & 0 deletions tests/routes/jinja-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,18 @@
</field>
</embed>
</expansive>
<expansive page_number_key="%s" key="test5">
<timeout>150</timeout>
<embed>
<title>T</title>
<colour>teal</colour>
<field>
<name>T</name>
<value>
{% for i in range(0, 600) %}T{% endfor %}
{% for i in range(0, 6025) %}X{% endfor %}
</value>
</field>
</embed>
</expansive>
</discord>
7 changes: 7 additions & 0 deletions tests/unit/test_xml_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ def test_expansive_message(self, _: mock.mock.MagicMock):
message = renderer.render("test3")
self.assertIsNotNone(message)

def test_expansive_with_static_elements(self, _: mock.mock.MagicMock):
template = "tests/routes/jinja-test.xml"

renderer: Renderer[JinjaEmbeds] = Renderer(Jinja2(), template)
message = renderer.render("test5")
self.assertEqual(len(message), 2)

def test_expansive_message_with_timeout(self, _: mock.mock.MagicMock):
renderer: Renderer[JinjaEmbeds] = Renderer(Jinja2(), "tests/routes/jinja-test.xml")
message = renderer.render("test4")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
]

ErrorEmbeds = Literal["test1", "test2", "menu_type", "unknown_type"]
JinjaEmbeds = Literal["test1", "test2", "test3", "test4"]
JinjaEmbeds = Literal["test1", "test2", "test3", "test4", "test5"]
Menus = Literal["Menu1", "Menu2", "Menu3", "Menu4"]
Modals = Literal["modal1", "modal2"]
CompleteJSONMessages = Literal[
Expand Down

0 comments on commit 3185043

Please sign in to comment.