#NEWLINE# def test_can_sign_url( self ) : #NEWLINE# #INDENT# signer = UrlSigner ( security_key = 'something' ) #NEWLINE# url = '10x11:12x13/-300x-300/center/middle/smart/some/image.jpg' #NEWLINE# expected = base64 . urlsafe_b64encode ( hmac . new ( 'something' , unicode ( url ) . encode ( 'utf-8' ) , hashlib . sha1 ) . digest ( ) ) #NEWLINE# actual = signer . signature ( url ) #NEWLINE# expect ( actual ) . to_equal ( expected )