#NEWLINE# def test_bytes( self ) : #NEWLINE# #INDENT# '\n        Verify that we can obtain bytes from rand_bytes() and\n        that they are different each time.  Test the parameter\n        of rand_bytes() for bad values.\n        ' #NEWLINE# b1 = rand . bytes ( 50 ) #NEWLINE# self . assertEqual ( len ( b1 ) , 50 ) #NEWLINE# b2 = rand . bytes ( num_bytes = 50 ) #NEWLINE# self . assertNotEqual ( b1 , b2 ) #NEWLINE# b3 = rand . bytes ( num_bytes = 0 ) #NEWLINE# self . assertEqual ( len ( b3 ) , 0 ) #NEWLINE# exc = self . assertRaises ( ValueError , rand . bytes , ( - 1 ) ) #NEWLINE# self . assertEqual ( str ( exc ) , 'num_bytes must not be negative' )