#NEWLINE# def test_diff_command_valid_usage_with_separator( self ) : #NEWLINE# #INDENT# result = self . csvdiff_cmd ( '--sep' , '\t' , 'id' , self . a_file_tsv , self . b_file_tsv ) #NEWLINE# self . assertEqual ( result . exit_code , 1 ) #NEWLINE# diff = result . diff #NEWLINE# patch . validate ( self ) #NEWLINE# assert patch . is_valid ( diff ) #NEWLINE# expected = { #NEWLINE# #INDENT# '_index' : [ 'id' ] , #NEWLINE# 'added' : [ { #NEWLINE# #INDENT# 'id' : '5' , #NEWLINE# 'name' : 'mira' , #NEWLINE# 'amount' : '81' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'removed' : [ { #NEWLINE# #INDENT# 'id' : '2' , #NEWLINE# 'name' : 'eva' , #NEWLINE# 'amount' : '63' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'changed' : [ { #NEWLINE# #INDENT# 'key' : [ '1' ] , #NEWLINE# 'fields' : { #NEWLINE# #INDENT# 'amount' : { #NEWLINE# #INDENT# 'from' : '20' , #NEWLINE# 'to' : '23' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'key' : [ '6' ] , #NEWLINE# 'fields' : { #NEWLINE# #INDENT# 'amount' : { #NEWLINE# #INDENT# 'from' : '10' , #NEWLINE# 'to' : '13' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertPatchesEqual ( diff , expected )