test_job_render.py (1336B)
1 #!/usr/bin/python3 2 3 import pytest 4 from autotako.job_render import _extract_name_from_stream_title 5 6 7 @pytest.mark.parametrize( 8 "input, expected", 9 [ 10 ( 11 # extract topic from brackets 12 "【100% Orange Juice】game for good friends!! #calliolive", 13 "100% Orange Juice", 14 ), 15 ( 16 # extract topic from brackets 17 "【ART & YAP】 So a cat and an owl walk into a room… and start drawing! 😼🦉w/ @NanashiMumei", 18 "ART & YAP", 19 ), 20 ( 21 # ensure search for closing bracket is non-greedy 22 "【HuniePop 2】OUT TO SAVE THE WORLD (WITH RIZZ)【Pavolia Reine/hololiveID 2nd gen】", 23 "HuniePop 2", 24 ), 25 ( 26 # strip hashtag from topic 27 "【 #ねっこよ24 】後半戦一発目Start✨マシュマロ読んでく!【 桃鈴ねね / 博衣こより / ホロライブ 】", 28 "ねっこよ24", 29 ), 30 ( 31 # strip hashtag from topic; angle brackets 32 "≪#holocountdown2024 - OFFCOLLAB WATCHALONG≫ Starting 2025 THE RIGHT WAY w/ @IRyS", 33 "holocountdown2024 - OFFCOLLAB WATCHALONG", 34 ), 35 ], 36 ) 37 def test_extract(input: str, expected: str | None): 38 assert _extract_name_from_stream_title(input) == expected