예제 #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"
예제 #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"
예제 #3
0
 def  setUp(self):
     """ Build the Delegate for the test """
     self.delegate = ChanceDelegate(0, [])
예제 #4
0
 def setUp(self):
     """ Build the Delegate for the test """
     self.delegate = ChanceDelegate(0, [])