#NEWLINE# def test_back_refs( self ) : #NEWLINE# #INDENT# path = get_path ( 'replace-1.json' ) #NEWLINE# policy = parse_redaction_policy_from_file ( path ) #NEWLINE# messages = [ ( 'Hello, world' , 'Hello, world' ) , ( '1234-2345-3456-4576' , 'XXXX-XXXX-XXXX-4576' ) , ( 'Words www.gmail.com is cool' , 'Words HOSTNAME.REDACTED.com is cool' ) , ( 'short.org' , 'HOSTNAME.REDACTED.org' ) , ( 'long.n4me.h-1.co.fr' , 'HOSTNAME.REDACTED.fr' ) , ( 'Ping 192.168.0.1' , 'Ping 0.192.1.168' ) , ( 'Magic word' , 'word: Magic word, word' ) ] #NEWLINE# for ( message , redacted_message ) in messages : #NEWLINE# #INDENT# assert_equal ( message , policy . redact ( message ) )