scaleway/tests/apis/test_api_account.py
def compare_results(permissions, service=None, name=None,
                            resource=None, result=None, include_locked=False):
            """ Resets the auth API endpoint /tokens/:id/permissions, call
            get_resources and compare results with what is expected.
            """
            if result is None:
                result = []

            self.make_fake_perms(permissions)
            resources = self.api.get_resources(
                service=service, name=name, resource=resource,
                include_locked=include_locked
            )
            # XOR on two sets returns the difference between them
            # Used because we don't know in which order api.get_resources
            # returns the resources.
            self.assertFalse(set(resources) ^ set(result))

            # Check the API has been requested with
            # ?include_locked set to `include_locked`
            self.assertEqual(
                httpretty.last_request().querystring.get('include_locked'),
                [str(include_locked)]
            )
 Resets the auth API endpoint /tokens/:id/permissions, call
            get_resources and compare results with what is expected.
            
Resets the auth API endpoint /tokens/:id/permissions, call
get_resources and compare results with what is expected.
Resets the auth API endpoint / tokens / : id / permissions call get_resources and compare results with what is expected .
def compare_results(permissions, service=None, name=None,
                            resource=None, result=None, include_locked=False):
            if result is None:
                result = []
            self.make_fake_perms(permissions)
            resources = self.api.get_resources(
                service=service, name=name, resource=resource,
                include_locked=include_locked
            )
            self.assertFalse(set(resources) ^ set(result))
            self.assertEqual(
                httpretty.last_request().querystring.get('include_locked'),
                [str(include_locked)]
            )
def compare_results ( permissions , service = None , name = None , resource = None , result = None , include_locked = False ) : if result is None : result = [ ] self . make_fake_perms ( permissions ) resources = self . api . get_resources ( service = service , name = name , resource = resource , include_locked = include_locked ) self . assertFalse ( set ( resources ) ^ set ( result ) ) self . assertEqual ( httpretty . last_request ( ) . querystring . get ( 'include_locked' ) , [ str ( include_locked ) ] )
Resets the auth API endpoint /tokens/:id/permissions, call
get_resources and compare results with what is expected.
Resets the auth API endpoint / tokens / : id / permissions call get_resources and compare results with what is expected .
""" Resets the auth API endpoint /tokens/:id/permissions, call
            get_resources and compare results with what is expected.
            """ # XOR on two sets returns the difference between them # Used because we don't know in which order api.get_resources # returns the resources. # Check the API has been requested with # ?include_locked set to `include_locked`
permissions
service
name
resource
result
include_locked