<s> from __future__ import absolute_import , unicode_literals <EOL> import unittest <EOL> from app import app <EOL> from PIL import Image <EOL> from io import BytesIO <EOL> class AppTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> app . config [ '<STR_LIT>' ] = True <EOL> self . app = app . test_client ( ) <EOL> def _open_image ( self , image_data ) : <EOL> strio = BytesIO ( ) <EOL> strio . write ( image_data ) <EOL> strio . seek ( <NUM_LIT:0> ) <EOL> return Image . open ( strio ) <EOL> def testIndex ( self ) : <EOL> with self . app . get ( '<STR_LIT:/>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> def test404 ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> def testHeaders ( self ) : <EOL> with self . app . get ( '<STR_LIT:/>' ) as r : <EOL> headers = r . headers <EOL> self . assertEqual ( headers [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( headers [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def testFavicon ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> def testRobotsTxt ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> def testHumansTxt ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> def testTrailingSlash ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> def testPlaceholder1 ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT> ) <EOL> self . assertEqual ( height , <NUM_LIT> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> def testPlaceholder2 ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> def testPlaceholder3 ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> def testPlaceholder4 ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT> ) <EOL> def testRetina ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT> ) <EOL> self . assertEqual ( height , <NUM_LIT:200> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT> ) <EOL> self . assertEqual ( height , <NUM_LIT:200> ) <EOL> def testFontsize ( self ) : <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> with self . app . get ( '<STR_LIT>' ) as r : <EOL> self . assertEqual ( r . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( r . mimetype , '<STR_LIT>' ) <EOL> img = self . _open_image ( r . data ) <EOL> width , height = img . size <EOL> self . assertEqual ( width , <NUM_LIT:200> ) <EOL> self . assertEqual ( height , <NUM_LIT:100> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
