<s> import stripe <EOL> from stripe . test . helper import StripeResourceTest <EOL> class MetadataTest ( StripeResourceTest ) : <EOL> def test_noop_metadata ( self ) : <EOL> charge = stripe . Charge ( id = '<STR_LIT>' ) <EOL> charge . description = '<STR_LIT:test>' <EOL> charge . save ( ) <EOL> self . requestor_mock . request . assert_called_with ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT:description>' : '<STR_LIT:test>' , <EOL> } , <EOL> None <EOL> ) <EOL> def test_unset_metadata ( self ) : <EOL> charge = stripe . Charge ( id = '<STR_LIT>' ) <EOL> charge . metadata = { } <EOL> charge . save ( ) <EOL> self . requestor_mock . request . assert_called_with ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : { } , <EOL> } , <EOL> None <EOL> ) <EOL> def test_whole_update ( self ) : <EOL> charge = stripe . Charge ( id = '<STR_LIT>' ) <EOL> charge . metadata = { '<STR_LIT>' : '<STR_LIT>' } <EOL> charge . save ( ) <EOL> self . requestor_mock . request . assert_called_with ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' } , <EOL> } , <EOL> None <EOL> ) <EOL> def test_individual_delete ( self ) : <EOL> charge = stripe . Charge ( id = '<STR_LIT>' ) <EOL> charge . metadata = { '<STR_LIT>' : None } <EOL> charge . save ( ) <EOL> self . requestor_mock . request . assert_called_with ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : { '<STR_LIT>' : None } , <EOL> } , <EOL> None <EOL> ) </s>
