コード例 #1
0
import unittest
from mock import Mock, patch
from pyon.util.int_test import IonIntegrationTestCase
from nose.plugins.attrib import attr

from pyon.core.exception import BadRequest, Conflict, Inconsistent, NotFound
from pyon.public import PRED, RT, IonObject, OT

from interface.objects import PolicyTypeEnum
from ion.service.policy_management_service import PolicyManagementService

from interface.services.core.ipolicy_management_service import PolicyManagementServiceClient


@attr('INT', group='coi')
@patch.dict('pyon.core.governance.governance_controller.CFG', IonIntegrationTestCase._get_alt_cfg({'interceptor': {'interceptors': {'governance': {'config': {'enabled': False}}}}}))
class TestPolicyManagementServiceInt(IonIntegrationTestCase):

    def setUp(self):

        # Start container
        self._start_container()
        self.container.start_rel_from_url('res/deploy/basic.yml')
        self.container.governance_controller.policy_event_callback = Mock()

        self.policy_management_service = PolicyManagementServiceClient()

    def test_policy(self):
        self._do_test_policy_crud()

    def _do_test_policy_crud(self):
コード例 #2
0
from pyon.util.int_test import IonIntegrationTestCase

from pyon.ion import exchange
from pyon.net.transport import BaseTransport
from pyon.public import PRED, RT, CFG, log, BadRequest, Conflict, Inconsistent, NotFound
from pyon.util.containers import DotDict
from ion.service.exchange_management_service import ExchangeManagementService

from interface.objects import ExchangeSpace, ExchangePoint, ExchangeName
from interface.services.core.iresource_registry_service import ResourceRegistryServiceClient
from interface.services.core.iexchange_management_service import ExchangeManagementServiceClient


@attr('INT', group='coi')
@patch.dict('pyon.ion.exchange.CFG', IonIntegrationTestCase._get_alt_cfg({'container':{'messaging':{'auto_register': True}}}))
class TestExchangeManagementServiceInt(IonIntegrationTestCase):

    def setUp(self):
        self._start_container()
        self.container.start_rel_from_url('res/deploy/basic.yml')

        self.ems = ExchangeManagementServiceClient()
        self.rr = ResourceRegistryServiceClient()

        orglist, _ = self.rr.find_resources(RT.Org)
        self.org_id = orglist[0]._id

        # we test actual exchange interaction in pyon, so it's fine to mock the broker interaction here
        self._clear_mocks()
コード例 #3
0
from pyon.public import PRED, RT, IonObject, OT

from interface.objects import PolicyTypeEnum
from ion.service.policy_management_service import PolicyManagementService

from interface.services.core.ipolicy_management_service import PolicyManagementServiceClient


@attr('INT', group='coi')
@patch.dict('pyon.core.governance.governance_controller.CFG',
            IonIntegrationTestCase._get_alt_cfg({
                'interceptor': {
                    'interceptors': {
                        'governance': {
                            'config': {
                                'enabled': False
                            }
                        }
                    }
                }
            }))
class TestPolicyManagementServiceInt(IonIntegrationTestCase):
    def setUp(self):

        # Start container
        self._start_container()
        self.container.start_rel_from_url('res/deploy/basic.yml')
        self.container.governance_controller.policy_event_callback = Mock()

        self.policy_management_service = PolicyManagementServiceClient()
コード例 #4
0
from pyon.ion import exchange
from pyon.net.transport import BaseTransport
from pyon.public import PRED, RT, CFG, log, BadRequest, Conflict, Inconsistent, NotFound
from pyon.util.containers import DotDict
from ion.service.exchange_management_service import ExchangeManagementService

from interface.objects import ExchangeSpace, ExchangePoint, ExchangeName
from interface.services.core.iresource_registry_service import ResourceRegistryServiceClient
from interface.services.core.iexchange_management_service import ExchangeManagementServiceClient


@attr('INT', group='coi')
@patch.dict('pyon.ion.exchange.CFG',
            IonIntegrationTestCase._get_alt_cfg(
                {'container': {
                    'messaging': {
                        'auto_register': True
                    }
                }}))
class TestExchangeManagementServiceInt(IonIntegrationTestCase):
    def setUp(self):
        self._start_container()
        self.container.start_rel_from_url('res/deploy/basic.yml')

        self.ems = ExchangeManagementServiceClient()
        self.rr = ResourceRegistryServiceClient()

        orglist, _ = self.rr.find_resources(RT.Org)
        self.org_id = orglist[0]._id

        # we test actual exchange interaction in pyon, so it's fine to mock the broker interaction here
        self._clear_mocks()
コード例 #5
0
import unittest
from mock import Mock, patch
from pyon.util.int_test import IonIntegrationTestCase
from nose.plugins.attrib import attr

from pyon.core.exception import BadRequest, Conflict, Inconsistent, NotFound
from pyon.public import PRED, RT, IonObject, OT

from interface.objects import PolicyTypeEnum
from ion.services.policy_management_service import PolicyManagementService

from interface.services.core.ipolicy_management_service import PolicyManagementServiceClient


@attr('INT', group='coi')
@patch.dict('pyon.core.governance.governance_controller.CFG', IonIntegrationTestCase._get_alt_cfg({'interceptor': {'interceptors': {'governance': {'config': {'enabled': False}}}}}))
class TestPolicyManagementServiceInt(IonIntegrationTestCase):

    def setUp(self):

        # Start container
        self._start_container()
        self.container.start_rel_from_url('res/deploy/basic.yml')
        self.container.governance_controller.policy_event_callback = Mock()

        self.policy_management_service = PolicyManagementServiceClient()

    def test_policy(self):
        self._do_test_policy_crud()

    def _do_test_policy_crud(self):