def testLoss(self): myManager = HM_manage.HMmanager() myLives = myManager.myLives myManager.myObfuscator = Obfuscator.aObfuscator("testWord") for i in range(0, myLives): print myManager.myLives myManager.checkCharacter('a') self.assertLess(myManager.winState, 0)
def testOngoing(self): myManager = HM_manage.HMmanager() myManager.myObfuscator = Obfuscator.aObfuscator("testWord") myManager.checkCharacter('a') self.assertEqual(myManager.winState, 0)
def testRun(self): myManager = HM_manage.HMmanager() myLives = myManager.myLives myManager.myObfuscator = Obfuscator.aObfuscator("testWord") myManager.checkCharacter('a') self.assertEqual(myManager.myLives, myLives - 1)
def __init__(self): self.myLives = 5 self.winState = 0 #0 = ongoing, 1 won, -1 lost self.mySelector = WordSelector.aWordSelector() self.myWord = self.mySelector.myWord self.myObfuscator = Obfuscator.aObfuscator(self.myWord)
def testRun(self): myManager = HM_manage.HMmanager() myLives = myManager.myLives myManager.myObfuscator = Obfuscator.aObfuscator("testWord") myManager.checkCharacter('a') self.assertEqual(myManager.myLives,myLives-1)