<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from tempfile import mkstemp <EOL> from cement . core import handler , backend , log <EOL> from cement . utils import test <EOL> from cement . utils . misc import rando <EOL> if sys . version_info [ <NUM_LIT:0> ] < <NUM_LIT:3> : <EOL> import configobj <EOL> else : <EOL> raise test . SkipTest ( <EOL> '<STR_LIT>' ) <EOL> APP = rando ( ) [ : <NUM_LIT:12> ] <EOL> CONFIG = """<STR_LIT>""" <EOL> class ConfigObjExtTestCase ( test . CementTestCase ) : <EOL> def setUp ( self ) : <EOL> _ , self . tmppath = mkstemp ( ) <EOL> f = open ( self . tmppath , '<STR_LIT>' ) <EOL> f . write ( CONFIG ) <EOL> f . close ( ) <EOL> self . app = self . make_app ( APP , <EOL> extensions = [ '<STR_LIT>' ] , <EOL> config_handler = '<STR_LIT>' , <EOL> config_files = [ self . tmppath ] , <EOL> argv = [ ] <EOL> ) <EOL> def tearDown ( self ) : <EOL> if os . path . exists ( self . tmppath ) : <EOL> os . remove ( self . tmppath ) <EOL> def test_configobj ( self ) : <EOL> self . app . setup ( ) <EOL> def test_has_section ( self ) : <EOL> self . app . setup ( ) <EOL> self . ok ( self . app . config . has_section ( '<STR_LIT>' ) ) <EOL> def test_keys ( self ) : <EOL> self . app . setup ( ) <EOL> res = '<STR_LIT>' in self . app . config . keys ( '<STR_LIT>' ) <EOL> self . ok ( res ) <EOL> def test_parse_file_bad_path ( self ) : <EOL> self . app . _meta . config_files = [ '<STR_LIT>' ] <EOL> self . app . setup ( ) <EOL> def test_parse_file ( self ) : <EOL> self . app . setup ( ) <EOL> self . eq ( self . app . config . get ( '<STR_LIT>' , '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . eq ( self . app . config . get_section_dict ( '<STR_LIT>' ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) </s>
