<s> """<STR_LIT>""" <EOL> from os import getcwd , path <EOL> from paste . deploy import loadapp <EOL> from webtest import TestApp <EOL> from gearbox . commands . setup_app import SetupAppCommand <EOL> from tg import config <EOL> from tg . util import Bunch <EOL> from depotexample import model <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> application_name = '<STR_LIT>' <EOL> def load_app ( name = application_name ) : <EOL> """<STR_LIT>""" <EOL> return TestApp ( loadapp ( '<STR_LIT>' % name , relative_to = getcwd ( ) ) ) <EOL> def setup_app ( ) : <EOL> """<STR_LIT>""" <EOL> cmd = SetupAppCommand ( Bunch ( options = Bunch ( verbose_level = <NUM_LIT:1> ) ) , Bunch ( ) ) <EOL> cmd . run ( Bunch ( config_file = '<STR_LIT>' , section_name = None ) ) <EOL> def setup_db ( ) : <EOL> """<STR_LIT>""" <EOL> engine = config [ '<STR_LIT>' ] . sa_engine <EOL> model . init_model ( engine ) <EOL> model . metadata . create_all ( engine ) <EOL> def teardown_db ( ) : <EOL> """<STR_LIT>""" <EOL> engine = config [ '<STR_LIT>' ] . sa_engine <EOL> model . metadata . drop_all ( engine ) <EOL> class TestController ( object ) : <EOL> """<STR_LIT>""" <EOL> application_under_test = application_name <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> self . app = load_app ( self . application_under_test ) <EOL> setup_app ( ) <EOL> def tearDown ( self ) : <EOL> """<STR_LIT>""" <EOL> model . DBSession . remove ( ) <EOL> teardown_db ( ) </s>
