#NEWLINE# @ responses . activate #NEWLINE# def test_cli_dataset_list_stdout( ) : #NEWLINE# #INDENT# datasets = '\n        [\n         {{\n          "owner":"{username}",\n          "id":"120c1c5aec87030449dfe2dff4e2a7c8",\n          "name":"first",\n          "description":"the first one",\n          "created":"2015-07-03T00:14:09.622Z",\n          "modified":"2015-07-03T00:14:09.622Z"\n         }},\n         {{\n          "owner":"{username}",\n          "name":"second",\n          "description":"the second one"\n          "id":"18571b87d4c139b6d10911d13cb0561f",\n          "created":"2015-05-05T22:43:10.832Z",\n          "modified":"2015-05-05T22:43:10.832Z"\n         }}\n        ]' . format ( username = username ) #NEWLINE# datasets = '' . join ( datasets . split ( ) ) #NEWLINE# responses . add ( responses . GET , 'https://api.mapbox.com/datasets/v1/{0}?access_token={1}' . format ( username , access_token ) , match_querystring = True , body = datasets , status = 200 , content_type = 'application/json' ) #NEWLINE# runner = CliRunner ( ) #NEWLINE# result = runner . invoke ( main_group , [ '--access-token' , access_token , 'datasets' , 'list' ] ) #NEWLINE# assert ( runner . exit_code == 0 ) #NEWLINE# assert ( result . output . strip ( ) == datasets . strip ( ) )