@@ -683,6 +683,56 @@ async def test_host_missing_fields(lobby_server):
683683 assert msg ["featured_mod" ] == "faf"
684684
685685
686+ @fast_forward (10 )
687+ async def test_host_game_name_only_spaces (lobby_server ):
688+ player_id , session , proto = await connect_and_sign_in (
689+ ("test" , "test_password" ),
690+ lobby_server
691+ )
692+
693+ await read_until_command (proto , "game_info" )
694+
695+ await proto .send_message ({
696+ "command" : "game_host" ,
697+ "mod" : "" ,
698+ "visibility" : "public" ,
699+ "title" : " " ,
700+ })
701+
702+ msg = await read_until_command (proto , "notice" , timeout = 10 )
703+
704+ assert msg == {
705+ "command" : "notice" ,
706+ "style" : "error" ,
707+ "text" : "Title must not be empty." ,
708+ }
709+
710+
711+ @fast_forward (10 )
712+ async def test_host_game_name_non_ascii (lobby_server ):
713+ player_id , session , proto = await connect_and_sign_in (
714+ ("test" , "test_password" ),
715+ lobby_server
716+ )
717+
718+ await read_until_command (proto , "game_info" )
719+
720+ await proto .send_message ({
721+ "command" : "game_host" ,
722+ "mod" : "" ,
723+ "visibility" : "public" ,
724+ "title" : "ÇÒÖL GÃMÊ"
725+ })
726+
727+ msg = await read_until_command (proto , "notice" , timeout = 10 )
728+
729+ assert msg == {
730+ "command" : "notice" ,
731+ "style" : "error" ,
732+ "text" : "Title must contain only ascii characters."
733+ }
734+
735+
686736async def test_play_game_while_queueing (lobby_server ):
687737 player_id , session , proto = await connect_and_sign_in (
688738 ("test" , "test_password" ),
0 commit comments