<s> from radiotherm . fields import Field <EOL> from tests . base_test_case import BaseTestCase <EOL> class TestConvertToHuman ( BaseTestCase ) : <EOL> def setUp ( self ) : <EOL> self . field = Field ( '<STR_LIT>' , '<STR_LIT>' , { <EOL> <NUM_LIT:0> : '<STR_LIT>' , <EOL> <NUM_LIT:1> : '<STR_LIT>' , <EOL> '<STR_LIT:foo>' : '<STR_LIT>' <EOL> } ) <EOL> def test_convert_int_success ( self ) : <EOL> ret = self . field . _convert_to_human ( <NUM_LIT:0> ) <EOL> self . assertEqual ( ret , '<STR_LIT>' ) <EOL> def test_convert_int_fail ( self ) : <EOL> self . assertRaises ( AttributeError , self . field . _convert_to_human , <NUM_LIT:3> ) <EOL> def test_convert_string_success ( self ) : <EOL> ret = self . field . _convert_to_human ( '<STR_LIT:foo>' ) <EOL> self . assertEqual ( ret , '<STR_LIT>' ) <EOL> def test_convert_string_fail ( self ) : <EOL> self . assertRaises ( AttributeError , self . field . _convert_to_human , '<STR_LIT:bar>' ) </s>
