Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/p/y/pyon-HEAD/pyon/core/governance/test/test_governance.py   pyon(Download)
from pyon.core.bootstrap import IonObject
from pyon.ion.resource import PRED, RT
from pyon.core.governance import ORG_MANAGER_ROLE, ORG_MEMBER_ROLE, ION_MANAGER, GovernanceHeaderValues
from pyon.core.governance import find_roles_by_actor, get_actor_header, get_system_actor_header, get_role_message_headers, get_valid_resource_commitments
from interface.services.examples.hello.ihello_service  import HelloServiceProcessClient
        headers = {'op': 'test_op', 'process': process, 'request': 'request', 'ion-actor-id': 'ionsystem', 'receiver': 'resource-registry',
                                   'sender-type': 'sender-type', 'resource-id': '123xyz' ,'sender-service': 'sender-service',
                                   'ion-actor-roles': {'ION': [ION_MANAGER, ORG_MANAGER_ROLE, ORG_MEMBER_ROLE]}}
 
        gov_values = GovernanceHeaderValues(headers)
        headers = {'op': 'test_op', 'request': 'request', 'ion-actor-id': 'ionsystem', 'receiver': 'resource-registry',
                   'sender-type': 'sender-type', 'resource-id': '123xyz' ,'sender-service': 'sender-service',
                   'ion-actor-roles': {'ION': [ION_MANAGER, ORG_MANAGER_ROLE, ORG_MEMBER_ROLE]}}
 
        gov_values = GovernanceHeaderValues(headers)
        headers = {'op': 'test_op', 'request': 'request', 'receiver': 'resource-registry',
                   'sender-type': 'sender-type', 'resource-id': '123xyz' ,'sender-service': 'sender-service',
                   'ion-actor-roles': {'ION': [ION_MANAGER, ORG_MANAGER_ROLE, ORG_MEMBER_ROLE]}}
 
        self.assertRaises(Inconsistent, GovernanceHeaderValues, headers)
 
        headers = {'op': 'test_op', 'request': 'request', 'ion-actor-id': 'ionsystem', 'receiver': 'resource-registry',
                   'sender-type': 'sender-type', 'resource-id': '123xyz' ,'sender-service': 'sender-service',
                   'ion-actor-123-roles': {'ION': [ION_MANAGER, ORG_MANAGER_ROLE, ORG_MEMBER_ROLE]}}