mirror of https://github.com/eyhc1/rendercv.git
unittest
This commit is contained in:
parent
ac920ab5fe
commit
dda101b543
|
@ -852,3 +852,16 @@ class TestDataModel(unittest.TestCase):
|
||||||
with self.subTest(msg="nonexistent file"):
|
with self.subTest(msg="nonexistent file"):
|
||||||
with self.assertRaises(FileNotFoundError):
|
with self.assertRaises(FileNotFoundError):
|
||||||
data_model.read_input_file("nonexistent.json")
|
data_model.read_input_file("nonexistent.json")
|
||||||
|
|
||||||
|
def test_mastodon_parsing(self):
|
||||||
|
mastodon_name = 'jpgoldberg@ioc.exchange'
|
||||||
|
expected = "https://ioc.exchange/@jpgoldberg"
|
||||||
|
result = data_model.Connection.MastodonUname2Url(mastodon_name)
|
||||||
|
with self.subTest("Without '@' prefix"):
|
||||||
|
self.assertEqual(result, expected)
|
||||||
|
|
||||||
|
mastodon_name = '@jpgoldberg@ioc.exchange'
|
||||||
|
expected = "https://ioc.exchange/@jpgoldberg"
|
||||||
|
result = data_model.Connection.MastodonUname2Url(mastodon_name)
|
||||||
|
with self.subTest("With '@' prefix"):
|
||||||
|
self.assertEqual(result, expected)
|
||||||
|
|
Loading…
Reference in New Issue