From 55d048460e26d22419d43f5bea2379dae0d67a02 Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Sat, 19 Sep 2020 19:21:18 +0800 Subject: [PATCH] new: test: convert_tags_to_org_mode_tags --- tests/test_buku.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_buku.py b/tests/test_buku.py index ab41e3f..cc88118 100644 --- a/tests/test_buku.py +++ b/tests/test_buku.py @@ -770,3 +770,17 @@ def test_convert_bookmark_set(export_type, exp_res, monkeypatch): res = convert_bookmark_set(bms, export_type=export_type) assert res['count'] == 3 assert exp_res == res['data'] + + +@pytest.mark.parametrize('tags,data', [ + [',', '\n'], + [',tag1,tag2,', ' :tag1:tag2:\n'], + [',word1 word2,', ' :word1_word2:\n'], + [',word1:word2,', ' :word1_word2:\n'], + [',##tag##,', ' :_tag_:\n'], + [',##tag##,!!tag!!,', ' :_tag_:\n'], +]) +def test_convert_tags_to_org_mode_tags(tags, data): + from buku import convert_tags_to_org_mode_tags + res = convert_tags_to_org_mode_tags(tags) + assert res == data