27 lines
962 B
Python
27 lines
962 B
Python
#!/usr/bin/env python3
|
|
"""Verify Gaya market, items 39063/39064, and /gem command suite."""
|
|
from pathlib import Path
|
|
import unittest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
class GayaMarketTest(unittest.TestCase):
|
|
def test_char_item_use_special_cases(self):
|
|
source = (ROOT / 'src/server/game/src/char_item.cpp').read_text(encoding='latin1')
|
|
special_block = source.split('case USE_SPECIAL:', 1)[1].split('switch (item->GetVnum())', 1)[0]
|
|
|
|
# 39063: Refresh Gaya Market
|
|
self.assertIn('if(item->GetVnum()==39063)', special_block)
|
|
self.assertIn('return RefreshGemALL();', special_block)
|
|
self.assertNotIn('item->SetCount', special_block.split('if(item->GetVnum()==39063)',1)[1])
|
|
|
|
# 39064: Gaya Market Expansion
|
|
self.assertIn('if(item->GetVnum()==39064)', special_block)
|
|
self.assertIn('if(OpenGemSlot())', special_block)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|