From 26b55e6c0c6a5ca794cbf13aaaa2f694ecd9a3db Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Wed, 29 Nov 2023 20:26:44 +0100 Subject: [PATCH] update make_it_something tests --- tests/test_rendering.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_rendering.py b/tests/test_rendering.py index fa88cee..e6a74e4 100644 --- a/tests/test_rendering.py +++ b/tests/test_rendering.py @@ -95,10 +95,14 @@ class TestRendering(unittest.TestCase): def test_make_it_something(self): # invalid input: input = "test" - keyword = "invalid keyword" - with self.subTest(msg="invalid keyword"): - with self.assertRaises(ValueError): - rendering.make_it_something(input, keyword) + something = "haha" + result = rendering.make_it_something(input, something) + with self.subTest(msg="match_str is none"): + self.assertEqual(result, "\\haha{test}") + + result = rendering.make_it_something(input, something, match_str="te") + with self.subTest(msg="match_str is not none"): + self.assertEqual(result, "\\haha{te}st") def test_make_it_bold(self): input = "some text"