Ejemplo n.º 1
0
    def test_tap_and_untap(self):
        creature_state = CreatureStateFactory(tapped=False)

        normalized = creature_state.normalize()
        creature_state.tap()
        self.assertNotEqual(creature_state.normalize(), normalized)

        normalized = creature_state.normalize()
        creature_state.untap()
        self.assertNotEqual(creature_state.normalize(), normalized)
Ejemplo n.º 2
0
    def test_attack(self):
        """Test that .attack() is saved when normalized."""
        state = CreatureStateFactory(tapped=False)

        normalized = state.normalize()
        state.attack()

        self.assertTrue(state.attacking)
        self.assertNotEqual(state.normalize(), normalized)

        state.remove_from_combat()
        self.assertEqual(state.normalize(), normalized)
Ejemplo n.º 3
0
    def test_block(self):
        """Test that .block(uid) is saved when normalized."""
        state = CreatureStateFactory(tapped=False)
        self.assertFalse(state.blocking)

        normalized = state.normalize()
        state.block(47)

        self.assertEqual(state.blocking, 47)
        self.assertNotEqual(state.normalize(), normalized)

        state.remove_from_combat()
        self.assertEqual(state.normalize(), normalized)