<s> import os <EOL> os . environ [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> from tests import base <EOL> def setUpModule ( ) : <EOL> """<STR_LIT>""" <EOL> base . enabledPlugins . append ( '<STR_LIT>' ) <EOL> base . enabledPlugins . append ( '<STR_LIT>' ) <EOL> base . enabledPlugins . append ( '<STR_LIT>' ) <EOL> base . enabledPlugins . append ( '<STR_LIT>' ) <EOL> base . startServer ( False ) <EOL> def tearDownModule ( ) : <EOL> """<STR_LIT>""" <EOL> base . stopServer ( ) <EOL> class S3SourceTestCase ( base . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( S3SourceTestCase , self ) . setUp ( ) <EOL> self . _user = self . model ( '<STR_LIT:user>' ) . createUser ( <EOL> '<STR_LIT>' , '<STR_LIT:password>' , '<STR_LIT>' , '<STR_LIT:user>' , <EOL> '<STR_LIT>' ) <EOL> def testCreateS3Source ( self ) : <EOL> """<STR_LIT>""" <EOL> path = '<STR_LIT>' <EOL> name = '<STR_LIT>' <EOL> prefix = '<STR_LIT>' <EOL> bucket = '<STR_LIT>' <EOL> params = { <EOL> '<STR_LIT:name>' : name , <EOL> '<STR_LIT>' : bucket , <EOL> '<STR_LIT>' : prefix , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : True <EOL> } <EOL> response = self . request ( path = path , method = '<STR_LIT:POST>' , params = params , user = self . _user ) <EOL> self . assertStatusOk ( response ) <EOL> source = response . json <EOL> self . assertEquals ( source [ '<STR_LIT:name>' ] , name , '<STR_LIT>' ) <EOL> minerva_metadata = source [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> self . assertEquals ( minerva_metadata [ '<STR_LIT>' ] , prefix , '<STR_LIT>' % prefix ) <EOL> self . assertEquals ( minerva_metadata [ '<STR_LIT>' ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEquals ( minerva_metadata [ '<STR_LIT>' ] , bucket , '<STR_LIT>' % bucket ) <EOL> path = '<STR_LIT>' % str ( minerva_metadata [ '<STR_LIT>' ] ) <EOL> response = self . request ( path = path , method = '<STR_LIT:GET>' , user = self . _user ) <EOL> self . assertStatusOk ( response ) <EOL> self . assertEquals ( response . json [ '<STR_LIT:name>' ] , prefix , '<STR_LIT>' % prefix ) </s>
