#NEWLINE# @ responses . activate #NEWLINE# def test_cli_dataset_put_feature_fromfile( tmpdir ) : #NEWLINE# #INDENT# tmpfile = str ( tmpdir . join ( 'test.put-feature.json' ) ) #NEWLINE# dataset = 'dataset-2' #NEWLINE# id = 'abc' #NEWLINE# feature = '\n        {{\n          "type":"Feature",\n          "id":"{0}",\n          "properties":{{}},\n          "geometry":{{"type":"Point","coordinates":[0,0]}}\n        }}' . format ( f ) #NEWLINE# feature = '' . join ( feature . split ( ) ) #NEWLINE# f = open ( tmpfile , 'w' ) #NEWLINE# f . write ( feature ) #NEWLINE# f . close ( ) #NEWLINE# responses . add ( responses . PUT , 'https://api.mapbox.com/datasets/v1/{0}/{1}/features/{2}?access_token={3}' . format ( username , dataset , id , access_token ) , match_querystring = True , status = 200 , body = feature , content_type = 'application/json' ) #NEWLINE# runner = CliRunner ( ) #NEWLINE# result = runner . invoke ( main_group , [ '--access-token' , access_token , 'datasets' , 'put-feature' , dataset , id , '--input' , tmpfile ] ) #NEWLINE# assert ( result . exit_code == 0 ) #NEWLINE# assert ( result . output . strip ( ) == feature . strip ( ) )