<s> import pytest <EOL> from taxi import settings <EOL> def test_list_setting_single_value ( ) : <EOL> l = settings . ListSetting ( ) <EOL> assert l . to_python ( '<STR_LIT:foo>' ) == [ '<STR_LIT:foo>' ] <EOL> def test_list_setting_multiple_values ( ) : <EOL> l = settings . ListSetting ( ) <EOL> assert l . to_python ( '<STR_LIT>' ) == [ '<STR_LIT:foo>' , '<STR_LIT:bar>' ] <EOL> def test_list_setting_removes_empty_elements ( ) : <EOL> l = settings . ListSetting ( ) <EOL> assert l . to_python ( '<STR_LIT>' ) == [ '<STR_LIT:foo>' , '<STR_LIT:bar>' ] <EOL> def test_int_setting_casts_to_int ( ) : <EOL> l = settings . IntegerSetting ( ) <EOL> assert l . to_python ( '<STR_LIT>' ) == <NUM_LIT> <EOL> def test_integer_list_setting_casts_to_int ( ) : <EOL> l = settings . IntegerListSetting ( ) <EOL> assert l . to_python ( '<STR_LIT>' ) == [ <NUM_LIT> , <NUM_LIT:12> ] <EOL> def test_bool_setting_casts_to_bool ( ) : <EOL> expected = { <EOL> True : [ '<STR_LIT:1>' , '<STR_LIT:true>' ] , <EOL> False : [ '<STR_LIT:0>' , '<STR_LIT:false>' ] <EOL> } <EOL> l = settings . BooleanSetting ( ) <EOL> for expected_value , input_values in expected . items ( ) : <EOL> for value in input_values : <EOL> assert l . to_python ( value ) == expected_value <EOL> def test_invalid_bool_raises_error ( ) : <EOL> l = settings . BooleanSetting ( ) <EOL> with pytest . raises ( ValueError ) : <EOL> l . to_python ( '<STR_LIT>' ) </s>
