#NEWLINE# def test_get_test( self ) : #NEWLINE# #INDENT# mock = flexmock ( memc ) #NEWLINE# value = ( 'xxx' + util . random_string ( constants . MAX_STRING_LENGTH ) ) #NEWLINE# mock . should_receive ( 'get' ) . and_return ( value ) #NEWLINE# results = memcache . get ( 'xxx' ) #NEWLINE# self . assertEquals ( len ( results ) , 2 ) #NEWLINE# self . assertEquals ( len ( results [ 0 ] ) , constants . NUM_SAMPLES ) #NEWLINE# self . assertEquals ( len ( results [ 1 ] ) , 0 ) #NEWLINE# mock . should_receive ( 'get' ) . and_raise ( Exception ( 'test exception' ) ) #NEWLINE# results = memcache . get ( 'xxx' ) #NEWLINE# self . assertEquals ( len ( results ) , 2 ) #NEWLINE# self . assertEquals ( len ( value [ 0 ] ) , constants . NUM_SAMPLES ) #NEWLINE# self . assertEquals ( len ( results [ 1 ] ) , constants . NUM_SAMPLES )