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

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

src/p/y/pyon-HEAD/pyon/core/governance/policy/test/test_policy_decision.py   pyon(Download)
        self.assertEqual(pdpm.get_service_pdp(service_key), pdpm.load_common_service_pdp)
 
        pdpm.load_service_policy_rules(service_key, self.permit_ION_MANAGER_rule)
 
        # see that the PDP for service is not the default anymore
 
        # check that service policies result in denying the request
        pdpm.load_service_policy_rules(service_key, self.deny_ION_MANAGER_rule)
        pdpm.load_resource_policy_rules(resource_id, self.permit_ION_MANAGER_rule)
        response = pdpm.check_agent_request_policies(invocation)
        self.assertEqual(response.value, "Deny")
 
        # check that resource policies result in denying the request
        pdpm.load_service_policy_rules(service_key, self.permit_ION_MANAGER_rule)
 
        # check that both service and resource policies need to allow a request
        pdpm.load_service_policy_rules(service_key, self.permit_ION_MANAGER_rule)
        pdpm.load_resource_policy_rules(resource_id, self.permit_ION_MANAGER_rule)
        response = pdpm.check_agent_request_policies(invocation)