''' Purpose: test mash.py with a beyonce, dinosaur, and wonder woman on the lawn ''' import url import mash # IMAGE INFO URL_LAWN = 'http://www.cs.virginia.edu/~cs1112/images/lawn.png' LOC_LAWN = 'lawn.png' IMG_LAWN = url.get_image( URL_LAWN, LOC_LAWN ) URL_BEY = 'http://www.cs.virginia.edu/~cs1112/images/green-beyonce.png' LOC_BEY = 'green-beyonce.png' IMG_BEY = url.get_image( URL_BEY, LOC_BEY ) IMG_BEY = mash.clean_up( IMG_BEY, mash.GREEN ) URL_DINO = 'http://www.cs.virginia.edu/~cs1112/images/green-dino.png' LOC_DINO = 'green-dino.png' IMG_DINO = url.get_image( URL_DINO, LOC_DINO ) IMG_DINO = mash.clean_up( IMG_DINO, mash.GREEN ) URL_WW = 'http://www.cs.virginia.edu/~cs1112/images/green-ww.png' LOC_WW = 'green-ww.png' IMG_WW = url.get_image( URL_WW, LOC_WW ) IMG_WW = mash.clean_up( IMG_WW, mash.GREEN ) def test_with_dino() : bg = IMG_LAWN.copy().convert( 'RGB') sx = 4 * bg.width // 18 sy = 12 * bg.height // 24 img = mash.combine( bg, IMG_DINO, sx, sy, mash.GREEN ) img.show() def test_with_beyonce() : bg = IMG_LAWN.copy().convert( 'RGB') sx = 5 * bg.width // 18 sy = 14 * bg.height // 24 img = mash.combine( bg, IMG_BEY, sx, sy, mash.GREEN ) img.show() def test_with_ww() : bg = IMG_LAWN.copy().convert( 'RGB') sx = 7 * bg.width // 18 sy = 12 * bg.height // 24 img = mash.combine( bg, IMG_WW, sx, sy, mash.GREEN ) img.show() def test() : test_with_beyonce() test_with_dino( ) test_with_ww() if ( __name__ == '__main__' ) : import smashing smashing.test()