def test_delete_user(username): """ test administrator to delete a user whose name is the giving name""" bt = BaseTest() user = bt.get_user_by_name(username) if(user == None): return 3 user_id = user['id'] endpoint = bt.get_service_endpoint('keystone') endpoint = endpoint + '/users/' + user_id response, content = bt.delete(endpoint) if(response['status'] == '200'): return 0 return 1
def test_delete_user(username): """ test administrator to delete a user whose name is the giving name""" bt = BaseTest() user = bt.get_user_by_name(username) if (user == None): return 3 user_id = user['id'] endpoint = bt.get_service_endpoint('keystone') endpoint = endpoint + '/users/' + user_id response, content = bt.delete(endpoint) if (response['status'] == '200'): return 0 return 1
def delete_tenant(name): """ test administrator to delete a tenant whose name is the giving name""" bt = BaseTest() tenant = bt.get_tenant_by_name(name) if(tenant == None): print 'the tenant named %s is not existed!, skipped' %name return 3 tenant_id = tenant['id'] endpoint = bt.get_service_endpoint('keystone') endpoint = endpoint + '/tenants/' + tenant_id response, content = bt.delete(endpoint) if(response['status'] == '204'): return 0 return 1
def test_delete_tenant_by_name(name): """ test administrator to delete a tenant whose name is the giving name""" bt = BaseTest() tenant = bt.get_tenant_by_name(name) if (tenant == None): print 'the tenant named %s is not existed!, skipped' % name return 3 tenant_id = tenant['id'] endpoint = bt.get_service_endpoint('keystone') endpoint = endpoint + '/tenants/' + tenant_id response, content = bt.delete(endpoint) if (response['status'] == '204'): return 0 return 1