コード例 #1
0
    def test_explain(self):
        """ Verifies explain runs if there is a success [aka _explain is implemented]."""
        constitution = Issue()
        constitution.name = self.strategy._CONSTITUTION
        self.DB.insert_one(db_constants.ISSUES, constitution)

        result = self.strategy.run()

        self.assertTrue(result)
        self.strategy.explain()
コード例 #2
0
    def test_run_fail_no_constitutional_stance_in_agn_stances(self):
        """ Verifies the function fails if the bill isn't unconstitutional."""
        constitution = Issue()
        constitution.name = self.strategy._CONSTITUTION
        self.DB.insert_one(db_constants.ISSUES, constitution)

        self.decision.agn_stances = [self.stance1]

        result = self.strategy.run()
        self.assertFalse(result)
        self.assertFalse(self.strategy._success)
        self.assertEquals(self.decision.result, None)
        self.assertEquals(self.decision.reason, None)
コード例 #3
0
    def test_run_success(self):
        """ Verifies that run() successfully makes a decision"""
        constitution = Issue()
        constitution.name = self.strategy._CONSTITUTION
        self.DB.insert_one(db_constants.ISSUES, constitution)

        result = self.strategy.run()

        self.assertTrue(result)
        self.assertTrue(self.strategy._success)
        self.assertEquals(self.decision.result, outcomes.AGN)
        self.assertEquals(self.decision.reason, self.decision.agn_stances)
        self.assertEquals(self.decision.downside, self.decision.for_stances)
コード例 #4
0
    def test_run_fail_consensus_for(self):
        """ Verifies the function fails if there is a consensus FOR the bill."""
        constitution = Issue()
        constitution.name = self.strategy._CONSTITUTION
        self.DB.insert_one(db_constants.ISSUES, constitution)

        self.group_result.outcome = outcomes.FOR
        self.credo_result.outcome = outcomes.FOR

        result = self.strategy.run()
        self.assertFalse(result)
        self.assertFalse(self.strategy._success)
        self.assertEquals(self.decision.result, None)
        self.assertEquals(self.decision.reason, None)