# Path: armada/api/controller/armada.py
# CONF = cfg.CONF
# class Apply(api.BaseResource):
#     def on_post(self, req, resp):
# 
# Path: armada/common/policies/base.py
# ARMADA = 'armada:%s'
# TILLER = 'tiller:%s'
# RULE_ADMIN_REQUIRED = 'rule:admin_required'
# RULE_ADMIN_OR_TARGET_PROJECT = (
#     'rule:admin_required or project_id:%(target.project.id)s')
# RULE_SERVICE_OR_ADMIN = 'rule:service_or_admin'
# def list_rules():
# 
# Path: armada/tests/test_utils.py
# def rand_uuid_hex():
# def rand_name(name='', prefix='armada'):
# def rand_bool():
# def rand_int(min, max):
# def rand_password(length=15):
# def attr(**kwargs):
#     def decorator(f):
# 
# Path: armada/tests/unit/api/base.py
# class BaseControllerTest(test_base.ArmadaTestCase):
#     def setUp(self):


import json
import mock
from oslo_config import cfg
from armada.api.controller import armada as armada_api
from armada.common.policies import base as policy_base
from armada.tests import test_utils
from armada.tests.unit.api import base
                   'wait': 'false',
                   'timeout': '100'}
        payload = {'hrefs': []}
        body = json.dumps(payload)

        result = self.app.simulate_post(path='/api/v1.0/apply',
                                        body=body,
                                        headers={
                                            'Content-Type': 'application/json'
                                        },
                                        params=options)
        self.assertEqual(result.status_code, 400)


class ArmadaControllerNegativeTest(base.BaseControllerTest):

    @test_utils.attr(type=['negative'])
    def test_armada_apply_raises_415_given_unsupported_media_type(self):
        """Tests the POST /api/v1.0/apply endpoint returns 415 given
        unsupported media type.
        """
        rules = {'armada:create_endpoints': '@'}
        self.policy.set_rules(rules)

        resp = self.app.simulate_post('/api/v1.0/apply', body=None)
        self.assertEqual(415, resp.status_code)


class ArmadaControllerNegativeRbacTest(base.BaseControllerTest):


# Path: armada/api/controller/armada.py
# CONF = cfg.CONF
# class Apply(api.BaseResource):
#     def on_post(self, req, resp):
# 
# Path: armada/common/policies/base.py
# ARMADA = 'armada:%s'
# TILLER = 'tiller:%s'
# RULE_ADMIN_REQUIRED = 'rule:admin_required'
# RULE_ADMIN_OR_TARGET_PROJECT = (
#     'rule:admin_required or project_id:%(target.project.id)s')
# RULE_SERVICE_OR_ADMIN = 'rule:service_or_admin'
# def list_rules():
# 
# Path: armada/tests/test_utils.py
# def rand_uuid_hex():
# def rand_name(name='', prefix='armada'):
# def rand_bool():
# def rand_int(min, max):
# def rand_password(length=15):
# def attr(**kwargs):
#     def decorator(f):
# 
# Path: armada/tests/unit/api/base.py
# class BaseControllerTest(test_base.ArmadaTestCase):
#     def setUp(self):


# Path: armada/tests/unit/api/test_armada_controller.py
import json
import mock
from oslo_config import cfg
from armada.api.controller import armada as armada_api
from armada.common.policies import base as policy_base
from armada.tests import test_utils
from armada.tests.unit.api import base

                   'wait': 'false',
                   'timeout': '100'}
        payload = {'hrefs': []}
        body = json.dumps(payload)

        result = self.app.simulate_post(path='/api/v1.0/apply',
                                        body=body,
                                        headers={
                                            'Content-Type': 'application/json'
                                        },
                                        params=options)
        self.assertEqual(result.status_code, 400)


class ArmadaControllerNegativeTest(base.BaseControllerTest):

    @test_utils.attr(type=['negative'])
    def test_armada_apply_raises_415_given_unsupported_media_type(self):
        """Tests the POST /api/v1.0/apply endpoint returns 415 given
        unsupported media type.
        """
        rules = {'armada:create_endpoints': '@'}
        self.policy.set_rules(rules)

        resp = self.app.simulate_post('/api/v1.0/apply', body=None)
        self.assertEqual(415, resp.status_code)


class ArmadaControllerNegativeRbacTest(base.BaseControllerTest):


    @test_utils.attr(type=['negative'])