Пример #1
0
    def test_parse_ability(self):
        f = StringIO(self.ex_ability)
        line = f.readline()
        result = p.get_ability_block(f, line)
        expected = [('name', 'antimage_blink'), ('ID', '5004'),
                    ('AbilityName', 'antimage_blink'),
                    ('var_type', 'FIELD_INTEGER'),
                    ('blink_range', '1000 1075 1150 1150')]

        self.assertEqual(result, expected)
        f.close()
Пример #2
0
    def test_parse_ability(self):
        f = StringIO(self.ex_ability)
        line = f.readline()
        result = p.get_ability_block(f, line)
        expected = [('name', 'antimage_blink'),
                    ('ID', '5004'),
                    ('AbilityName', 'antimage_blink'),
                    ('var_type', 'FIELD_INTEGER'),
                    ('blink_range', '1000 1075 1150 1150')]

        self.assertEqual(result, expected)
        f.close()
Пример #3
0
 def test_parse_hero(self):
     f = StringIO(self.ex_hero)
     line = f.readline()
     result = p.get_ability_block(f, line)
     expected = [('name', 'npc_dota_hero_antimage'), ('HeroID', '1'),
                 ('Ability4', 'antimage_mana_void'), ('SlotIndex', '0'),
                 ('SlotName', 'weapon'),
                 ('SlotText', '#LoadoutSlot_Weapon'),
                 ('TextureWidth', '128'), ('TextureHeight', '256'),
                 ('MaxPolygonsLOD0', '400'), ('MaxPolygonsLOD1', '350'),
                 ('HeroType', 'DOTA_BOT_HARD_CARRY'), ('SoloDesire', '1')]
     self.assertEqual(result, expected)
     f.close()
Пример #4
0
 def test_parse_hero(self):
     f = StringIO(self.ex_hero)
     line = f.readline()
     result = p.get_ability_block(f, line)
     expected = [('name', 'npc_dota_hero_antimage'),
                 ('HeroID', '1'),
                 ('Ability4', 'antimage_mana_void'),
                 ('SlotIndex', '0'),
                 ('SlotName', 'weapon'),
                 ('SlotText', '#LoadoutSlot_Weapon'),
                 ('TextureWidth', '128'),
                 ('TextureHeight', '256'),
                 ('MaxPolygonsLOD0', '400'),
                 ('MaxPolygonsLOD1', '350'),
                 ('HeroType', 'DOTA_BOT_HARD_CARRY'),
                 ('SoloDesire', '1')]
     self.assertEqual(result, expected)
     f.close()