scaleway/tests/apis/test_api_metadata.py
def fake_route_conf(_, uri, headers):
            """ Fakes the /conf route.

            Returns metadata of a running server. Our tests don't need to have
            all the metadata of a server, so only a few values are returned.

            If ?format=json is set, return a JSON dict with a application/json
            content
            type.

            If no format is given, return a text/plain response with a "shell"
            format.
            """
            querystring = parse_qs(urlparse(uri).query)

            if 'json' in querystring.get('format', []):
                return 200, headers, json.dumps(json_response)

            headers['content-type'] = 'text/plain'
            return 200, headers, '\n'.join(
                '%s="%s"' % (key, value)
                for key, value in json_response.items()
            )
 Fakes the /conf route.

            Returns metadata of a running server. Our tests don't need to have
            all the metadata of a server, so only a few values are returned.

            If ?format=json is set, return a JSON dict with a application/json
            content
            type.

            If no format is given, return a text/plain response with a "shell"
            format.
            
Fakes the /conf route.
Returns metadata of a running server. Our tests don't need to have
all the metadata of a server, so only a few values are returned.

If ?format=json is set, return a JSON dict with a application/json
content
type.

If no format is given, return a text/plain response with a "shell"
format.
Fakes the / conf route . Returns metadata of a running server . Our tests don ' t need to have all the metadata of a server so only a few values are returned . If ?format = json is set return a JSON dict with a application / json content type . If no format is given return a text / plain response with a " shell " format .
def fake_route_conf(_, uri, headers):
            querystring = parse_qs(urlparse(uri).query)
            if 'json' in querystring.get('format', []):
                return 200, headers, json.dumps(json_response)
            headers['content-type'] = 'text/plain'
            return 200, headers, '\n'.join(
                '%s="%s"' % (key, value)
                for key, value in json_response.items()
            )
def fake_route_conf ( _ , uri , headers ) : querystring = parse_qs ( urlparse ( uri ) . query ) if 'json' in querystring . get ( 'format' , [ ] ) : return 200 , headers , json . dumps ( json_response ) headers [ 'content-type' ] = 'text/plain' return 200 , headers , '\n' . join ( '%s="%s"' % ( key , value ) for key , value in json_response . items ( ) )
Fakes the /conf route.
Fakes the / conf route .
""" Fakes the /conf route.

            Returns metadata of a running server. Our tests don't need to have
            all the metadata of a server, so only a few values are returned.

            If ?format=json is set, return a JSON dict with a application/json
            content
            type.

            If no format is given, return a text/plain response with a "shell"
            format.
            """
_
uri
headers