Пример #1
0
    def test_reroll_causes_fumble(self):
        """
        Test that reloading resulting in glitches can cause a fumble.
        """

        roll = Roll(3)
        self.assertFalse(roll.fumble)
        roll.reroll()
        self.assertTrue(roll.fumble)
Пример #2
0
    def test_reroll_causes_glitch(self):
        """
        Test that reloading resulting in glitches can cause a glitch.
        """

        roll = Roll(3)
        self.assertFalse(roll.glitch)
        roll.reroll()
        self.assertTrue(roll.glitch)
Пример #3
0
    def test_reroll_glitches_updated(self):
        """
        Test that rerolling updates the number of glitches.
        """

        roll = Roll(4)
        self.assertEquals(roll.glitches, 2)
        roll.reroll()
        self.assertEquals(roll.glitches, 3)
Пример #4
0
    def test_reroll_hits_updated(self):
        """
        Test that rerolling updates the number of hits.
        """

        roll = Roll(4)
        self.assertEquals(roll.hits, 2)
        roll.reroll()
        self.assertEquals(roll.hits, 4)
Пример #5
0
    def test_reroll_hits_unaffected(self):
        """
        Test that rerolling does not affect hits.
        """

        roll = Roll(4)
        self.assertEquals(roll.dice, [6, 5, 3, 2])
        roll.reroll()
        self.assertEquals(roll.dice, [6, 5, 1, 2])
Пример #6
0
    def test_reroll_exploded_rerolled(self):
        """
        Test that exploded dice that are not hits are also rerolled.
        """

        roll = Roll(3, edge=True)
        self.assertEquals(roll.dice, [1, 2, 6, 1])
        self.assertEquals(roll.original_dice_pool, 3)
        self.assertEquals(roll.dice_pool, 4)
        roll.reroll()
        self.assertEquals(roll.dice, [6, 3, 4, 5])
        self.assertEquals(roll.original_dice_pool, 3)
        self.assertEquals(roll.dice_pool, 4)
Пример #7
0
    def test_reroll_dont_explode(self):
        """
        Test that rerolled that are sixes dice do not explode.
        """

        roll = Roll(3)
        self.assertEquals(roll.dice, [1, 2, 6])
        self.assertEquals(roll.original_dice_pool, 3)
        self.assertEquals(roll.dice_pool, 3)
        roll.reroll()
        self.assertEquals(roll.dice, [6, 6, 5])
        self.assertEquals(roll.original_dice_pool, 3)
        self.assertEquals(roll.dice_pool, 3)