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

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

src/p/y/pyon-HEAD/pyon/core/governance/test/test_negotiation.py   pyon(Download)
 
        with self.assertRaises(Inconsistent) as cm:
            negotiation_handler.update_negotiation()
        self.assertIn('The Service Agreement Proposal must have a negotiation resource id associated with it',cm.exception.message)
 
        sap = IonObject(OT.EnrollmentProposal,consumer=self.actor_identity._id, provider=self.org._id )
 
        with self.assertRaises(Inconsistent) as cm:
            negotiation_handler.update_negotiation(sap)
 
 
        neg_id = negotiation_handler.update_negotiation(sap)
 
        self.assertEqual(self.event_pub.publish_event.called,True)
        counter_sap = Negotiation.create_counter_proposal(negotiation, ProposalStatusEnum.REJECTED, ProposalOriginatorEnum.PROVIDER)
 
        neg_id = negotiation_handler.update_negotiation(counter_sap, 'Fake rejection reason')
 
        self.assertEqual(len(negotiation.proposals),2)
        counter_sap = Negotiation.create_counter_proposal(negotiation, ProposalStatusEnum.ACCEPTED, ProposalOriginatorEnum.PROVIDER)
 
        neg_id = negotiation_handler.update_negotiation(counter_sap)
        self.assertEqual(len(negotiation.proposals),3)
        self.assertEqual(negotiation.negotiation_status, NegotiationStatusEnum.REJECTED)