<s> from pymysql . optionfile import Parser <EOL> from unittest import TestCase <EOL> from pymysql . _compat import PY2 <EOL> try : <EOL> from cStringIO import StringIO <EOL> except ImportError : <EOL> from io import StringIO <EOL> __all__ = [ '<STR_LIT>' ] <EOL> _cfg_file = ( r"""<STR_LIT>""" ) <EOL> class TestParser ( TestCase ) : <EOL> def test_string ( self ) : <EOL> parser = Parser ( ) <EOL> if PY2 : <EOL> parser . readfp ( StringIO ( _cfg_file ) ) <EOL> else : <EOL> parser . read_file ( StringIO ( _cfg_file ) ) <EOL> self . assertEqual ( parser . get ( "<STR_LIT:default>" , "<STR_LIT:string>" ) , "<STR_LIT:foo>" ) <EOL> self . assertEqual ( parser . get ( "<STR_LIT:default>" , "<STR_LIT>" ) , "<STR_LIT:bar>" ) <EOL> self . assertEqual ( parser . get ( "<STR_LIT:default>" , "<STR_LIT>" ) , "<STR_LIT>" ) </s>
