-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtestBuildMonsters.py
74 lines (53 loc) · 3.63 KB
/
testBuildMonsters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-
import unittest
from buildMonsters import BuildMonsters
import os
class TestBuildMonstersVs(unittest.TestCase):
def setUp(self):
unittest.TestLoader.sortTestMethodsUsing = None
self.func = BuildMonsters()
def test(self):
self.assertTrue(True)
# def test_load_monsters(self):
# directory_path = os.getcwd()
# data = self.func.pf.load_csv(directory_path+"/monstercsv/RadGridExport.csv")
# print("Monsters:", data[2])
# self.assertGreater(len(data), 0)
# def test_normalize_monsters(self):
# directory_path = os.getcwd()
# raw = self.func.pf.load_csv(directory_path+"/monstercsv/RadGridExport.csv")
# print("Monsters2:", self.func.normalize_monster_data(raw)[0])
# self.assertGreater(len(raw), 0)
# def test_get_monster_details(self):
# directory_path = os.getcwd()
# raw = self.func.normalize_monster_data(self.func.pf.load_csv(directory_path+"/monstercsv/RadGridExport.csv"))
# details = self.func.get_details(raw[0])
# #print("Details:", details)
# self.assertIsNotNone(details)
def test_parse_header(self):
text = '<h1 class="title">Aapoph Serpentfolk</h1> Aapophs possess greater strength and stronger venom than their zyss kin, but they lack zyss\' intelligence and innate magic. Unlike their selfish superiors, aapophs are communal and group together to hunt, wrestle, and sleep curled together in pits. Though they\'re looked down upon and insulted by zyss, most aapophs lack the higher brain functions to recognize when they\'re being insulted, much less plan or execute a rebellion. Aapophs often have unusual physical mutations—horns, vestigial tails, or spines protruding from their scales—yet these variations have little impact on their overall combat prowess— and combat prowess is the measure by which zyss judge them. <br/> <br/> <b><u><a href="Skills.aspx?ID=5&General=true">Recall Knowledge - Humanoid</a></u> (<u><a href="Skills.aspx?ID=14">Society</a></u>)</b> : DC 20 '
raw = self.func.parse_header(text)
print("Parsed:", raw)
self.assertIsNotNone(raw)
def test_parse_recall(self):
text = 'Recall Knowledge - Humanoid ( Society ) : DC 20 Recall Knowledge - Undead (Religion) : DC 22'
raw = self.func.parse_recall(text)
print("Recall:", raw)
self.assertGreater(len(raw), 0)
def test_parse_stats(self):
text = {'name': 'Aapoph Serpentfolk', 'family': 'Serpentfolk', 'source': 'Bestiary 2', 'rarity': 'Uncommon', 'size': 'Medium', 'type': 'Humanoid', 'traits': ['Humanoid', 'Mutant', 'Serpentfolk'], 'level': '3', 'spoilers?': '—', 'link': 'https://2e.aonprd.com/Monsters.aspx?ID=799'}
monster = self.func.load_monster(text)
print("Monster:", monster)
self.assertIsNotNone(monster)
# def test_parse_stats2(self):
# text = {'name': 'Aapoph Serpentfolk', 'family': 'Serpentfolk', 'source': 'Bestiary 2', 'rarity': 'Uncommon', 'size': 'Medium', 'type': 'Humanoid', 'traits': ['Humanoid', 'Mutant', 'Serpentfolk'], 'level': '3', 'spoilers?': '—', 'link': 'https://2e.aonprd.com/Monsters.aspx?ID=333'}
# monster = self.func.load_monster(text)
# print("Monster:", monster)
# self.assertIsNotNone(monster)
# def test_monster_details(self):
# directory_path = os.getcwd()
# raw = self.func.pf.load_csv(directory_path+"/monstercsv/RadGridExport.csv")
# def test_save_data(self):
# self.assertIsNotNone(self.func.save_data(self.func.build_monsters()))
if __name__ == '__main__':
unittest.main()