Example #1
0
class TestSpellTargetingSingle():
    """
    Tests for spells targeting single character
    """
    def __init__(self):
        """
        Default constructor
        """
        super().__init__()
        self.level = None
        self.character = None
        self.spell_generator = None

    def setup(self):
        """
        Setup test cases
        """
        self.level = LevelBuilder().build()

        self.character = (CharacterBuilder()
                                .with_level(self.level)
                                .with_location((5, 5))
                                .build())

        self.spell_generator = SpellGeneratorBuilder().build()

    def test_target_single(self):
        """
        Targeting a single character should be possible
        """
        spell = self.spell_generator.create_spell(spell_name = 'healing wind',
                                                  targets = [self.character])

        assert_that(self.character, is_in(spell.targets))
Example #2
0
    def setup(self):
        """
        Setup test cases
        """
        self.level = LevelBuilder().build()

        self.character = CharacterBuilder().with_level(self.level).with_location((5, 5)).build()

        self.spell_generator = SpellGeneratorBuilder().build()