update make_it_something tests

This commit is contained in:
Sina Atalay 2023-11-29 20:26:44 +01:00
parent 3c70ef26aa
commit 26b55e6c0c
1 changed files with 8 additions and 4 deletions

View File

@ -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"