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

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

src/p/y/pyon-HEAD/pyon/core/governance/test/test_governance.py   pyon(Download)
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
from pyon.util.context import LocalContextMixin
 
        # all actors have a defaul org_member_role
        actor_roles = find_roles_by_actor(actor_id)
        self.assertDictEqual(actor_roles, {'ION': [ORG_MEMBER_ROLE]})
 
        self.rr.create_association(actor_id, PRED.hasRole, manager_role_id)
 
        actor_roles = find_roles_by_actor(actor_id)
        role_header = get_role_message_headers({'ION': [manager_role, member_role]})
        self.assertDictEqual(actor_roles, role_header)
        self.rr.create_association(actor_id, PRED.hasRole, operator2_role_id)
 
        actor_roles = find_roles_by_actor(actor_id)
 
        role_header = get_role_message_headers({'ION': [manager_role, member_role], 'Second_Org': [operator2_role, member2_role]})
        org2_id, _ = self.rr.update(org2)
 
        actor_roles = find_roles_by_actor(actor_id)
 
        self.assertEqual(len(actor_roles), 2)