#NEWLINE# @ run_with_all_backends #NEWLINE# def testCachingResponse( self ) : #NEWLINE# #INDENT# log = SyncLog ( ) #NEWLINE# log . save ( ) #NEWLINE# self . assertFalse ( log . has_cached_payload ( V1 ) ) #NEWLINE# self . assertFalse ( log . has_cached_payload ( V2 ) ) #NEWLINE# self . assertEqual ( None , log . get_cached_payload ( V1 ) ) #NEWLINE# self . assertEqual ( None , log . get_cached_payload ( V2 ) ) #NEWLINE# log . invalidate_cached_payloads ( ) #NEWLINE# payload = '<node>melting hippo</node>' #NEWLINE# log . set_cached_payload ( payload , V1 ) #NEWLINE# self . assertTrue ( log . has_cached_payload ( V1 ) ) #NEWLINE# self . assertFalse ( log . has_cached_payload ( V2 ) ) #NEWLINE# self . assertEqual ( payload , log . get_cached_payload ( V1 ) ) #NEWLINE# self . assertEqual ( None , log . get_cached_payload ( V2 ) ) #NEWLINE# v2_payload = '<node>melting hippo 2.0</node>' #NEWLINE# log . set_cached_payload ( v2_payload , V2 ) #NEWLINE# self . assertTrue ( log . has_cached_payload ( V1 ) ) #NEWLINE# self . assertTrue ( log . has_cached_payload ( V2 ) ) #NEWLINE# self . assertEqual ( payload , log . get_cached_payload ( V1 ) ) #NEWLINE# self . assertEqual ( v2_payload , log . get_cached_payload ( V2 ) ) #NEWLINE# log . invalidate_cached_payloads ( ) #NEWLINE# self . assertFalse ( log . has_cached_payload ( V1 ) ) #NEWLINE# self . assertFalse ( log . has_cached_payload ( V2 ) ) #NEWLINE# self . assertEqual ( None , log . get_cached_payload ( V1 ) ) #NEWLINE# self . assertEqual ( None , log . get_cached_payload ( V2 ) )