#NEWLINE# @ responses . activate #NEWLINE# def test_cli_dataset_batch_update_feature_inline( ) : #NEWLINE# #INDENT# dataset = 'dataset-3' #NEWLINE# puts = '\n    [\n      {"type":"Feature","id":"a","properties":{},"geometry":{"type":"Point","coordinates":[0,0]}},\n      {"type":"Feature","id":"b","properties":{},"geometry":{"type":"Point","coordinates":[1,1]}}\n    ]\n    ' #NEWLINE# deletes = '["c"]' #NEWLINE# puts = '' . join ( puts . split ( ) ) #NEWLINE# expected = '{{"put":{0},"delete":{1}}}' . format ( puts , deletes ) #NEWLINE# responses . add ( responses . POST , 'https://api.mapbox.com/datasets/v1/{0}/{1}/features?access_token={2}' . format ( username , dataset , access_token ) , status = 200 , body = expected , match_querystring = True , content_type = 'application/json' ) #NEWLINE# runner = CliRunner ( ) #NEWLINE# result = runner . invoke ( main_group , [ '--access-token' , access_token , 'datasets' , 'batch-update-features' , dataset , puts , deletes ] ) #NEWLINE# assert ( result . exit_code == 0 ) #NEWLINE# assert ( result . output . strip ( ) == dataset )