Files
WoW-Hybrid-gateway/tests/native_spellbook_tabs_test.py
2026-11-26 10:27:52 +02:00

17 lines
1.4 KiB
Python

"""#113/#114: profession abilities in the spellbook General tab; Mounts tab (content f6415a13, Blizzard files)."""
from pathlib import Path
D = Path(__file__).resolve().parents[1] / 'ops/content-sbgeneral-20261126'
t = lambda n: (D / n).read_bytes().decode().replace('\r\n', '\n')
cat, item, frame, camelot, xml = t('5408627.after.lua'), t('5408635.after.lua'), t('5484847.after.lua'), t('6993216.after.lua'), t('5408623.after.xml')
# General tab appends one header group per profession skill line (past GetNumSpellBookSkillLines), real slots.
assert 'if self.skillLineIndex == Enum.SpellBookSkillLineIndex.General and SpellBookOctoAppendProfessionGroups then' in cat
assert 'local first = C_SpellBook.GetNumSpellBookSkillLines() + 1;' in cat
assert 'self.octoProfessionSkillLines[skillLineIndex]' in cat
# No separate Professions tab; Mounts tab registered after the skill-line tabs.
assert 'SpellBookOctoProfessionsCategoryMixin' not in cat + camelot
assert camelot.index('SpellBookOctoMountsCategoryMixin') < camelot.index('SpellBookPetCategoryMixin')
assert '["MOUNT"] = { template = "SpellBookOctoMountItemTemplate"' in frame
assert 'name="SpellBookOctoMountItemTemplate" inherits="SpellBookItemTemplate" mixin="SpellBookOctoMountItemMixin"' in xml
assert 'C_MountJournal.SummonByID(mountID);' in item and 'C_MountJournal.Dismiss();' in item
print('Spellbook General professions + Mounts tab PASS.')