#NEWLINE# def test_setResponse( self ) : #NEWLINE# #INDENT# '\n        When C{setResponse} is called with a string that is the username and\n        the hashed challenge separated with a space, they will be set on the\n        L{CramMD5Credentials}.\n        ' #NEWLINE# c = CramMD5Credentials ( ) #NEWLINE# chal = c . getChallenge ( ) #NEWLINE# c . setResponse ( b' ' . join ( ( b'squirrel' , hexlify ( HMAC ( b'supersecret' , chal ) . digest ( ) ) ) ) ) #NEWLINE# self . assertTrue ( c . checkPassword ( b'supersecret' ) ) #NEWLINE# self . assertEqual ( c . username , b'squirrel' )