def setUp(self): self.DB = PymongoDB.get_db() load_data.load_data() self.member = self.DB.find_one(db_constants.MEMBERS, {"full_name" : "vote_test"}) self.MEMBER = "vote_test" self.BILL1 = "VOTE_BILL1" self.BILL2 = "VOTE_BILL2" self.BILL3 = "VOTE_BILL3" self.GROUP1 = "VOTE_GROUP1" self.GROUP2 = "VOTE_GROUP2" self.strategy1_name = "AlwaysSucceed" self.strategy2_name = "AlwaysFail" self.strategy3_name = "AlwaysFail2" self.strategy4_name = "Inactive" self.bill1 = self.DB.find_one(db_constants.BILLS, queries.bill_query(self.BILL1)) self.bill2 = self.DB.find_one(db_constants.BILLS, queries.bill_query(self.BILL2)) self.bill3 = self.DB.find_one(db_constants.BILLS, queries.bill_query(self.BILL3)) self.group1 = self.DB.find_one(db_constants.GROUPS, queries.bill_query(self.GROUP1)) self.group2 = self.DB.find_one(db_constants.GROUPS, queries.bill_query(self.GROUP2)) AlwaysFailStrategy.call_count = 0 self.DB.DB.drop_collection(db_constants.DECISIONS)
def setUp(self): self.DB = PymongoDB.get_db() load_data.load_data() self.member = self.DB.find_one(db_constants.MEMBERS, {"full_name" : "member_analyze_test"}) self.BILL1 = "BILL1" self.BILL2 = "BILL2" self.BILL3 = "BILL3" self.GROUP1 = "GROUP1" self.GROUP2 = "GROUP2" self.bill1 = self.DB.find_one(db_constants.BILLS, queries.bill_query(self.BILL1)) self.bill2 = self.DB.find_one(db_constants.BILLS, queries.bill_query(self.BILL2)) self.bill3 = self.DB.find_one(db_constants.BILLS, queries.bill_query(self.BILL3)) self.group1 = self.DB.find_one(db_constants.GROUPS, queries.bill_query(self.GROUP1)) self.group2 = self.DB.find_one(db_constants.GROUPS, queries.bill_query(self.GROUP2))
def setUpClass(cls): # Make sure that the database is clean before this class is run. cls.old_config = config.CONFIG config.load_config(os.path.dirname(__file__) + "/../../src/config/staging.json") configure_logging.configure_logging() load_data.load_data()
def setUp(self): self.DB = PymongoDB.get_db() load_data.load_data()