<s> import os <EOL> from tempfile import mkstemp <EOL> from nose . tools import assert_equals <EOL> from citools . main import main <EOL> from citools . config import Configuration <EOL> class TestConfigurationLoading ( object ) : <EOL> def setUp ( self ) : <EOL> self . config = Configuration ( ) <EOL> self . content = """<STR_LIT>""" <EOL> self . set_config_file ( self . content ) <EOL> def set_config_file ( self , content ) : <EOL> handle , self . filename = mkstemp ( prefix = "<STR_LIT>" , suffix = "<STR_LIT>" , text = True ) <EOL> self . file = open ( self . filename , "<STR_LIT:w>" ) <EOL> self . file . write ( content ) <EOL> self . file . close ( ) <EOL> self . file = open ( self . filename , "<STR_LIT:r>" ) <EOL> def test_proper_ini_parsing ( self ) : <EOL> self . config . read_config ( file = self . filename ) <EOL> assert_equals ( "<STR_LIT>" , self . config . get ( '<STR_LIT>' , '<STR_LIT:password>' ) ) <EOL> def test_ini_parsing_parsers_slashes ( self ) : <EOL> self . config . read_config ( file = self . filename ) <EOL> assert_equals ( "<STR_LIT>" , self . config . get ( '<STR_LIT>' , '<STR_LIT:file>' ) ) <EOL> def test_using_specified_configuration_file ( self ) : <EOL> main ( argv = [ "<STR_LIT>" , self . filename , "<STR_LIT>" ] , config = self . config , do_exit = False ) <EOL> assert_equals ( "<STR_LIT>" , self . config . get ( '<STR_LIT>' , '<STR_LIT:file>' ) ) <EOL> def test_empty_validate_arguments ( self ) : <EOL> main ( argv = [ "<STR_LIT>" ] , config = self . config , do_exit = False ) <EOL> assert True <EOL> def tearDown ( self ) : <EOL> if not self . file . closed : <EOL> self . file . close ( ) <EOL> if os . path . exists ( self . filename ) : <EOL> os . remove ( self . filename ) </s>
