Ejemplo n.º 1
0
    def test_collect_source_type(self):
        """ Verifies collect type return stances only with the specified source."""
        array = self.generate_collect_type_stance_array()
        result = util.collect_source_db_type(db_constants.MEMBERS, array)

        for stance in result:
            self.assertEquals(stance.source_db, db_constants.MEMBERS)
Ejemplo n.º 2
0
def _MI_stances(decision, db_source=None):
    """Updates a specific MI_stance such as MI_stance or MI_group. It take the
    for and agn stances for the decision, filters them by the appropriate
    database, and then calls compare_stances to determine which side is
    strongest.

    Arguments:
        decision: the decision object to update
        db_source: the name of the database to filter stances by. 
        
    Returns:
        A list showing the side that is stronger. It is of the form:
            
            [[FOR|AGN], List_Of_Compelling_Stances_From_Winning_Side]
    """
    logger.LOGGER.info("Updating MI stances from source db %s" % db_source)
    fors = decision.for_stances
    agns = decision.agn_stances

    if db_source is not None:
        fors = util.collect_source_db_type(db_source, fors)
        agns = util.collect_source_db_type(db_source, agns)
    return _compare_stances(fors, agns)