Exemple #1
0
class shouldApply(unittest.TestCase):
    """ Test cases of shouldApply """
    def setUp(self):
        """ Build the Delegate for the test """
        self.delegate = ChanceDelegate(0, [])

    def should(self):
        """ Test that the effect should be applied if the chance is higher """
        self.delegate.chance = 70
        should = self.delegate.shouldApply(20)
        assert should, "The effect should be applied"

    def shouldNot(self):
        """ Test that the effect should not be applied if the chance is lower """
        self.delegate.chance = 20
        should = self.delegate.shouldApply(70)
        assert not should, "The effect should not be applied"
Exemple #2
0
class shouldApply(unittest.TestCase):
    """ Test cases of shouldApply """
    
    def  setUp(self):
        """ Build the Delegate for the test """
        self.delegate = ChanceDelegate(0, [])
        
    def should(self):
        """ Test that the effect should be applied if the chance is higher """
        self.delegate.chance = 70
        should = self.delegate.shouldApply(20)
        assert should, "The effect should be applied"
        
    def shouldNot(self):
        """ Test that the effect should not be applied if the chance is lower """
        self.delegate.chance = 20
        should = self.delegate.shouldApply(70)
        assert not should, "The effect should not be applied"
Exemple #3
0
 def  setUp(self):
     """ Build the Delegate for the test """
     self.delegate = ChanceDelegate(0, [])
Exemple #4
0
 def setUp(self):
     """ Build the Delegate for the test """
     self.delegate = ChanceDelegate(0, [])