<s> from shakespeare . tests import * <EOL> import shakespeare . model as model <EOL> import shakespeare . tests . test_stats <EOL> class TestStatsController ( TestController ) : <EOL> def setUp ( self ) : <EOL> self . text = make_fixture ( ) <EOL> self . text2 = make_fixture2 ( ) <EOL> shakespeare . tests . test_stats . stats_fixture ( self . text ) <EOL> def tearDown ( self ) : <EOL> model . metadata . drop_all ( ) <EOL> model . metadata . create_all ( ) <EOL> def test_index ( self ) : <EOL> url = url_for ( controller = '<STR_LIT>' , action = '<STR_LIT:index>' ) <EOL> res = self . app . get ( url ) <EOL> assert '<STR_LIT>' in res <EOL> def test_text_stats_index ( self ) : <EOL> url = url_for ( controller = '<STR_LIT>' , action = '<STR_LIT:text>' , id = None ) <EOL> res = self . app . get ( url ) <EOL> assert self . text . name in res <EOL> assert self . text2 . name in res <EOL> def test_text_stats ( self ) : <EOL> url = url_for ( controller = '<STR_LIT>' , action = '<STR_LIT:text>' , id = self . text . name ) <EOL> res = self . app . get ( url ) <EOL> assert '<STR_LIT>' in res <EOL> def test_text_no_stats ( self ) : <EOL> url = url_for ( controller = '<STR_LIT>' , action = '<STR_LIT:text>' , id = self . text2 . name ) <EOL> res = self . app . get ( url ) <EOL> assert '<STR_LIT>' in res , res <EOL> def test_word_stats ( self ) : <EOL> shakespeare . tests . test_stats . stats_fixture ( self . text2 ) <EOL> word = '<STR_LIT>' <EOL> url = url_for ( controller = '<STR_LIT>' , action = '<STR_LIT>' , id = word ) <EOL> return <EOL> res = self . app . get ( url ) <EOL> assert '<STR_LIT>' in res <EOL> assert self . text . title in res <EOL> assert self . text2 . title in res <EOL> assert '<STR_LIT:3>' in res </s>
