<s> import main <EOL> import mock <EOL> from protorpc import message_types <EOL> def test_list_greetings ( testbed ) : <EOL> api = main . GreetingApi ( ) <EOL> response = api . list_greetings ( message_types . VoidMessage ( ) ) <EOL> assert len ( response . items ) == <NUM_LIT:2> <EOL> def test_get_greeting ( testbed ) : <EOL> api = main . GreetingApi ( ) <EOL> request = main . GreetingApi . get_greeting . remote . request_type ( id = <NUM_LIT:1> ) <EOL> response = api . get_greeting ( request ) <EOL> assert response . message == '<STR_LIT>' <EOL> def test_multiply_greeting ( testbed ) : <EOL> api = main . GreetingApi ( ) <EOL> request = main . GreetingApi . multiply_greeting . remote . request_type ( <EOL> times = <NUM_LIT:4> , <EOL> message = '<STR_LIT>' ) <EOL> response = api . multiply_greeting ( request ) <EOL> assert response . message == '<STR_LIT>' * <NUM_LIT:4> <EOL> def test_authed_greet ( testbed ) : <EOL> api = main . AuthedGreetingApi ( ) <EOL> with mock . patch ( '<STR_LIT>' ) as user_mock : <EOL> user_mock . return_value = None <EOL> response = api . greet ( message_types . VoidMessage ( ) ) <EOL> assert response . message == '<STR_LIT>' <EOL> user_mock . return_value = mock . Mock ( ) <EOL> user_mock . return_value . email . return_value = '<STR_LIT>' <EOL> response = api . greet ( message_types . VoidMessage ( ) ) <EOL> assert response . message == '<STR_LIT>' </s>
