示例#1
0
class applyLock(unittest.TestCase):
    """ Test cases of applyLock """
    
    def  setUp(self):
        """ Build the Delegate for the test """
        self.user = BuildPokemonBattleWrapper()
        self.lastAction = 2
        self.user.lastAction = self.lastAction
        
        self.turns = 2
        self.delegate = MultiTurnDelegate(None)
        self.delegate.turns = self.turns
        
        self.delegate.applyLock(self.user)
        self.actionLock = self.user.actionLock
        
    def parent(self):
        """ Test that the parent is the effect's user """
        assert self.actionLock.parent == self.user, "Lock's parent should be the using Pkmn"
        
    def action(self):
        """ Test that the action is the user's last action """
        assert self.actionLock.action == self.lastAction, "Lock's action should be the user's last action"
        
    def turnsToGo(self):
        """ Test that the turnsToGo are the effect's turns - 1 """
        assert self.actionLock.turnsToGo == self.turns -1, "Lock's turns to go should be effect's turns -1 since the effect has actually already done one of its chain"
示例#2
0
class applyLock(unittest.TestCase):
    """ Test cases of applyLock """
    def setUp(self):
        """ Build the Delegate for the test """
        self.user = BuildPokemonBattleWrapper()
        self.lastAction = 2
        self.user.lastAction = self.lastAction

        self.turns = 2
        self.delegate = MultiTurnDelegate(None)
        self.delegate.turns = self.turns

        self.delegate.applyLock(self.user)
        self.actionLock = self.user.actionLock

    def parent(self):
        """ Test that the parent is the effect's user """
        assert self.actionLock.parent == self.user, "Lock's parent should be the using Pkmn"

    def action(self):
        """ Test that the action is the user's last action """
        assert self.actionLock.action == self.lastAction, "Lock's action should be the user's last action"

    def turnsToGo(self):
        """ Test that the turnsToGo are the effect's turns - 1 """
        assert self.actionLock.turnsToGo == self.turns - 1, "Lock's turns to go should be effect's turns -1 since the effect has actually already done one of its chain"