<s> import os . path <EOL> from twisted . trial . unittest import TestCase <EOL> from smartanthill . configprocessor import ConfigProcessor <EOL> from smartanthill . exception import ConfigKeyError <EOL> class ConfigProcessorCase ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . config = ConfigProcessor ( <EOL> os . path . dirname ( os . path . realpath ( __file__ ) ) , <EOL> { "<STR_LIT>" : "<STR_LIT>" } ) <EOL> def test__singleton ( self ) : <EOL> self . assertEqual ( self . config , ConfigProcessor ( ) ) <EOL> def test_structure ( self ) : <EOL> self . assertIn ( "<STR_LIT>" , self . config ) <EOL> self . assertIn ( "<STR_LIT>" , self . config ) <EOL> self . assertTrue ( self . config . get ( "<STR_LIT>" ) ) <EOL> _service_structure = set ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> for v in self . config . get ( "<STR_LIT>" ) . values ( ) : <EOL> self . assertEqual ( set ( v . keys ( ) ) , _service_structure ) <EOL> def test_useroptions ( self ) : <EOL> self . assertEqual ( self . config . get ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> def test_invalidkey ( self ) : <EOL> self . assertRaises ( ConfigKeyError , self . config . get , "<STR_LIT>" ) <EOL> self . assertEqual ( self . config . get ( "<STR_LIT>" , "<STR_LIT:default>" ) , "<STR_LIT:default>" ) </s>
