Esempio n. 1
0
class SmithArmorTest(unittest.TestCase):
    def setUp(self):
        self.sut = SmithArmor()

    def test_generate_color(self):
        book_color = BookColor()
        colors = book_color.get_list()
        self.assertTrue(self.sut.generate_color() in colors)

    def test_create_check_type(self):
        armor_types = BookArmor().get_types()

        armor = self.sut.create()
        self.assertTrue(armor.armor_type in armor_types)

    def test_create_check_piece(self):
        armor_pieces = BookArmor().get_pieces()

        armor = self.sut.create()
        self.assertTrue(armor.piece in armor_pieces)

    def test_create_check_quality(self):
        qualities = BookQuality().get_list()

        armor = self.sut.create()
        self.assertTrue(armor.quality in qualities)

    def test_create_check_color(self):
        colors = BookColor().get_list()

        armor = self.sut.create()
        self.assertTrue(armor.color in colors)
Esempio n. 2
0
 def test_faction_receives_an_armor(self):
     colors = BookColor().get_list()
     armor_smith = SmithArmor()
     new_armor = armor_smith.create()
     self.sut.rack_armor.give_armor(new_armor)
     given_arm = self.sut.rack_armor.armors[new_armor.id]
     self.assertTrue(given_arm.color in colors)
Esempio n. 3
0
 def test_character_gets_an_armor_and_automatically_equips_it(self):
     armor_smith = SmithArmor()
     for piece in armor_smith.armor_pieces:
         self.sut.rack_armor.remove_armor(piece)
     new_armor = armor_smith.create()
     piece = new_armor.piece
     self.sut.rack_armor.give_armor(new_armor)
     equipped_armor = self.sut.rack_armor.get_equipped_armor(piece)
     self.assertEqual(equipped_armor, new_armor)
Esempio n. 4
0
    def setUp(self):
        self._clock = Clock()
        self.locale_id = 1000
        self.book_stat = BookStat()
        self.sut_smithy_weapon = SmithWeapon()
        self.sut_smithy_armor = SmithArmor()
        self.sut_brains = Brains()

        self.sut_faction = Faction(
            experience=0,
            name='Red',
            faction_id='1000',
            clock=self._clock,
            smithy_weapon=self.sut_smithy_weapon,
            smithy_armor=self.sut_smithy_armor,
            brains=self.sut_brains,
        )

        self.sut2_faction = Faction(
            experience=0,
            name='blue',
            faction_id='1001',
            clock=self._clock,
            smithy_weapon=self.sut_smithy_weapon,
            smithy_armor=self.sut_smithy_armor,
            brains=self.sut_brains,
        )

        self.sut = self.sut_faction.create_vpc(name='sut')
        self.sut2 = self.sut2_faction.create_vpc(name='sut2')

        arena = HexMap()
        arena.arena_ground = 'plains'
        arena.arena_height = 10
        arena.create_arena(radius=5)

        self.sut_dm = DungeonMaster(
            clock=Clock(),
            dungeon=arena,
            locale_id=self.locale_id,
        )

        self.sut_dm.add_char(
            member=self.sut,
            faction=self.sut_faction,
            edge='sw',
        )

        self.sut_dm.add_char(
            member=self.sut2,
            faction=self.sut2_faction,
            edge='se',
        )

        weapon_smith = SmithWeapon()
        new_weapon = weapon_smith.create()
        self.sut.rack_weapon.give_weapon(new_weapon)
Esempio n. 5
0
    def setUp(self):
        self._clock = Clock()
        self.sut_name = 'sut'
        self.sut_smithy_weapon = SmithWeapon()
        self.sut_smithy_armor = SmithArmor()

        self.sut = Faction(
            experience=0,
            name=self.sut_name,
            faction_id=0,
            clock=self._clock,
            smithy_weapon=self.sut_smithy_weapon,
            smithy_armor=self.sut_smithy_armor,
        )
Esempio n. 6
0
    def setUp(self):
        self.locale_id = 5000
        self.start_time = 1

        self.sut = DungeonMaster(
                clock=Clock(),
                dungeon=self.create_arena(),
                locale_id=self.locale_id,
            )

        self.sut.clock.add_locale(
                locale_id=self.locale_id,
                local_time=self.start_time,
            )

        self._book_stat = BookStat()
        self.smith_weapon = SmithWeapon()
        self.smith_armor = SmithArmor()
        self.brains = Brains()
Esempio n. 7
0
 def setUp(self):
     self.sut = SmithArmor()