<s> import unittest <EOL> from openrunlog import models , util <EOL> fbid = '<STR_LIT>' <EOL> email = '<STR_LIT>' <EOL> class BCryptTests ( unittest . TestCase ) : <EOL> def test_bcrypt ( self ) : <EOL> password = '<STR_LIT:password>' <EOL> self . assertTrue ( util . check_pwd ( password , util . hash_pwd ( password ) ) ) <EOL> class ImageHTMLTests ( unittest . TestCase ) : <EOL> expected_fb_url = '<STR_LIT>' <EOL> expected_robo_url = '<STR_LIT>' <EOL> expected_bigrobo_url = '<STR_LIT>' <EOL> def test_fb_image_url ( self ) : <EOL> url = util . fb_image_url ( fbid ) <EOL> self . assertEqual ( url , self . expected_fb_url ) <EOL> def test_robohash_img_url ( self ) : <EOL> url = util . robohash_image_url ( email , <NUM_LIT:50> ) <EOL> self . assertEqual ( url , self . expected_robo_url ) <EOL> def test_image_html ( self ) : <EOL> expected_base_html = '<STR_LIT>' <EOL> expected_fb_html = expected_base_html . format ( self . expected_fb_url ) <EOL> expected_robo_html = expected_base_html . format ( self . expected_robo_url ) <EOL> expected_bigrobo_html = expected_base_html . format ( self . expected_bigrobo_url ) <EOL> fbuser = models . User ( display_name = '<STR_LIT>' , email = email ) <EOL> fbuser . facebook [ '<STR_LIT:id>' ] = fbid <EOL> robouser = models . User ( display_name = '<STR_LIT>' , email = email ) <EOL> fb_html = util . image_html ( fbuser , '<STR_LIT>' ) <EOL> robo_html = util . image_html ( robouser , '<STR_LIT>' ) <EOL> bigrobo_html = util . image_html ( robouser , '<STR_LIT>' ) <EOL> self . assertEqual ( expected_fb_html , fb_html ) <EOL> self . assertEqual ( expected_robo_html , robo_html ) <EOL> self . assertEqual ( expected_bigrobo_html , bigrobo_html ) </s>
