<s> import debile . utils . config as config_utils <EOL> import os <EOL> import shutil <EOL> import yaml <EOL> import unittest <EOL> class ConfigTestCase ( unittest . TestCase ) : <EOL> config = os . path . expanduser ( '<STR_LIT>' ) <EOL> config_dir = os . path . expanduser ( '<STR_LIT>' ) <EOL> @ classmethod <EOL> def setUp ( self ) : <EOL> if not os . path . exists ( self . config_dir ) : <EOL> os . makedirs ( self . config_dir ) <EOL> with open ( self . config , '<STR_LIT:w>' ) as f : <EOL> f . write ( yaml . dump ( dict ( A = '<STR_LIT:a>' ) ) ) <EOL> @ classmethod <EOL> def tearDown ( self ) : <EOL> if os . path . isfile ( self . config ) : <EOL> shutil . rmtree ( self . config_dir , ignore_errors = True ) <EOL> def test_find_config_file_that_exists ( self ) : <EOL> found_file = config_utils . _find_config_file ( '<STR_LIT>' ) <EOL> self . assertEqual ( found_file , self . config ) <EOL> def test_find_config_file_that_not_exists ( self ) : <EOL> self . assertRaises ( Exception , config_utils . _find_config_file , '<STR_LIT>' ) <EOL> def test_get_config ( self ) : <EOL> file_content = config_utils . get_config ( '<STR_LIT>' ) <EOL> self . assertEqual ( file_content [ '<STR_LIT:A>' ] , '<STR_LIT:a>' ) <EOL> def test_get_config_passing_path ( self ) : <EOL> file_content = config_utils . get_config ( '<STR_LIT>' , self . config ) <EOL> self . assertEqual ( file_content [ '<STR_LIT:A>' ] , '<STR_LIT:a>' ) </s>
