<s> '''<STR_LIT>''' <EOL> import pytest <EOL> from pushkin . request . requests import NotificationRequestSingle <EOL> from pushkin . request . requests import NotificationRequestBatch <EOL> from pushkin . context import config <EOL> from pushkin . database import database <EOL> @ pytest . fixture <EOL> def mock_log ( mocker ) : <EOL> mocker . patch ( "<STR_LIT>" ) <EOL> def test_valid_notification_proto ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_notification_proto_without_login_id ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( None , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert not NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_notification_proto_without_title ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , None , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert not NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_notification_proto_empty_title ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert not NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_notification_proto_without_content ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , "<STR_LIT>" , None , "<STR_LIT>" ) <EOL> assert not NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_notification_proto_empty_content ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert not NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_valid_notification_proto_without_screen ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_valid_notification_proto_empty_screen ( mock_log ) : <EOL> '''<STR_LIT>''' <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert NotificationRequestBatch ( [ notification ] ) . validate_single ( notification ) <EOL> def test_notification_proto_empty_screen_process ( mocker , mock_log ) : <EOL> '''<STR_LIT>''' <EOL> mocker . patch ( '<STR_LIT>' ) <EOL> notification = NotificationRequestSingle ( <NUM_LIT> , "<STR_LIT>" , "<STR_LIT>" ) <EOL> NotificationRequestBatch ( [ notification ] ) . process_single ( notification ) <EOL> database . get_raw_messages . assert_called_with ( <NUM_LIT> , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , config . game , <EOL> config . world_id , config . dry_run ) </s>
