def initApp(self): ''' This function initializes the home controller and view ''' self.logger = Logger(); self.viewObj = GiftExchangeCLI(self.logger, APP_LANGUAGE_FILE); self.homeScreenController = HomeScreen(self.logger, self.viewObj); self.memberController = MemberController(self.logger, self.viewObj, SAVED_MEMBER_FILE); self.hatController = HatController(self.logger, self.viewObj, self.memberController.getRegisteredMembers()); self.simController = SimController(self.logger, self.viewObj, self.memberController.getRegisteredMembers()); self.welcomeMessage(); return;
def setUp(self): self.langFilePath = dirname( os.getcwd()) + "\\Resources\\EnglishMessages.txt" self.memberFilePath = dirname( os.getcwd()) + "\\Resources\\testMemberList.txt" self.memberObjs = [ FamilyMember("testMemOne", None, Gift("testMemOne")), FamilyMember("testMemTwo", None, Gift("testMemTwo")) ] self.namesInHat = ["vj", "a"] f = open(self.memberFilePath, "w") f.write("vj\na") f.close() self.logger = Logger() self.viewObj = GiftExchangeCLI(self.logger, self.langFilePath) self.homeScreenController = HomeScreen(self.logger, self.viewObj) self.memberController = MemberController(self.logger, self.viewObj, self.memberFilePath) return
def setUp(self): unittest.TestCase.setUp(self) self.langFilePath = dirname( os.getcwd()) + "\\Resources\\EnglishMessages.txt" self.memberFilePath = dirname( os.getcwd()) + "\\Resources\\testMemberList.txt" self.memberObjs = [ FamilyMember("testMemOne", None, Gift("testMemOne")), FamilyMember("testMemTwo", None, Gift("testMemTwo")) ] self.namesInHat = ["vj", "a"] f = open(self.memberFilePath, "w") f.write("vj\na") f.close() self.logger = Logger() self.viewObj = GiftExchangeCLI(self.logger, self.langFilePath) self.memberController = MemberController(self.logger, self.viewObj, self.memberFilePath) self.magicHatObj = MagicHat( self.logger, self.viewObj, self.memberController.getRegisteredMembers())