<s> import unittest <EOL> import os <EOL> import googkit . compat . configparser as configparser <EOL> from googkit . lib . config import Config <EOL> SCRIPT_PATH = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> TEST_CONFIG_1 = os . path . join ( SCRIPT_PATH , '<STR_LIT>' ) <EOL> TEST_CONFIG_2 = os . path . join ( SCRIPT_PATH , '<STR_LIT>' ) <EOL> TEST_CONFIG_3 = os . path . join ( SCRIPT_PATH , '<STR_LIT>' ) <EOL> DEFAULT_CONFIG = os . path . join ( SCRIPT_PATH , '<STR_LIT>' ) <EOL> class TestConfig ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . cfg = Config ( ) <EOL> self . cfg . parser = configparser . ConfigParser ( ) <EOL> with open ( DEFAULT_CONFIG ) as fp : <EOL> if hasattr ( self . cfg . parser , '<STR_LIT>' ) : <EOL> self . cfg . parser . read_file ( fp ) <EOL> else : <EOL> self . cfg . parser . readfp ( fp ) <EOL> def test_load_with_no_user_config ( self ) : <EOL> cfg = Config ( ) <EOL> cfg . load ( TEST_CONFIG_1 , None , TEST_CONFIG_3 ) <EOL> self . assertEqual ( cfg . parser . get ( '<STR_LIT>' , '<STR_LIT:test>' ) , '<STR_LIT>' ) <EOL> with self . assertRaises ( configparser . NoSectionError ) : <EOL> cfg . parser . get ( '<STR_LIT>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( cfg . parser . get ( '<STR_LIT>' , '<STR_LIT:test>' ) , '<STR_LIT>' ) <EOL> def test_load ( self ) : <EOL> cfg = Config ( ) <EOL> cfg . load ( TEST_CONFIG_1 , TEST_CONFIG_2 , TEST_CONFIG_3 ) <EOL> self . assertEqual ( cfg . parser . get ( '<STR_LIT>' , '<STR_LIT:test>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( cfg . parser . get ( '<STR_LIT>' , '<STR_LIT:test>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( cfg . parser . get ( '<STR_LIT>' , '<STR_LIT:test>' ) , '<STR_LIT>' ) <EOL> def test_development_dir ( self ) : <EOL> self . assertEqual ( self . cfg . development_dir ( ) , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
