<s> import re <EOL> import unittest <EOL> from mapreduce import main <EOL> class MainTest ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def testCreateApplication ( self ) : <EOL> """<STR_LIT>""" <EOL> main . create_application ( ) <EOL> def testRedirectRegularExpression ( self ) : <EOL> """<STR_LIT>""" <EOL> basepath = '<STR_LIT>' <EOL> extensions = { '<STR_LIT>' : False , <EOL> '<STR_LIT:/>' : False , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True } <EOL> self . staticMatchesExtensions ( basepath , extensions ) <EOL> basepath = '<STR_LIT>' <EOL> self . staticMatchesExtensions ( basepath , extensions ) <EOL> basepath = '<STR_LIT>' <EOL> self . staticMatchesExtensions ( basepath , extensions ) <EOL> def staticMatchesExtensions ( self , basepath , extensions ) : <EOL> """<STR_LIT>""" <EOL> for ext , should_match in extensions . iteritems ( ) : <EOL> if should_match : <EOL> self . assertMatches ( basepath + ext , main . STATIC_RE ) <EOL> else : <EOL> self . assertNotMatches ( basepath + ext , main . STATIC_RE ) <EOL> def assertMatches ( self , text , regex ) : <EOL> """<STR_LIT>""" <EOL> m = re . match ( regex , text ) <EOL> if not m : <EOL> self . fail ( '<STR_LIT>' % ( text , regex ) ) <EOL> def assertNotMatches ( self , text , regex ) : <EOL> """<STR_LIT>""" <EOL> m = re . match ( regex , text ) <EOL> if m : <EOL> self . fail ( '<STR_LIT>' <EOL> % ( text , regex , m . group ( <NUM_LIT:0> ) ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
