예제 #1
0
def find_all_pathfinder_spells():
    campaign = PathfinderCampaign()
    spell_listfiles = campaign.find_spell_listfiles()
    spells = []

    for (lst, source) in spell_listfiles:
        spells = spells + parse_spells(lst, source)

    return spells
class TestCampaign(TestCase):

    maxDiff = None

    def setUp(self):
        self.campaign = PathfinderCampaign()

    def test_find_spell_files_finds_all_campaign_components(self):
        filetuples = self.campaign.find_spell_listfiles()
        files = map(lambda t: t[0], filetuples)

        for path in ["roleplaying_game/core_rulebook/cr_spells.lst",
                     "roleplaying_game/ultimate_magic/um_spells.lst"]:
            self.assertIn(Path(self.campaign.root, path), files)

    def test_find_feat_files_finds_all_campaign_components(self):
        filetuples = self.campaign.find_feat_listfiles()
        files = map(lambda t: t[0], filetuples)

        for path in ["roleplaying_game/core_rulebook/cr_feats.lst",
                     "roleplaying_game/ultimate_magic/um_feats.lst",
                     "roleplaying_game/ultimate_combat/uc_feats.lst"]:
            self.assertIn(Path(self.campaign.root, path), files)
 def setUp(self):
     self.campaign = PathfinderCampaign()