Example #1
0
 def test_add(self):
     """Add a new character to the rooster."""
     char = Character('test', 80, Character.Races.charr, Character.Sex.male,
                      Character.Professions.guardian, {}, None)
     rooster = Rooster(self.ROOSTER)
     rooster.add(char)
     self.assertEqual(len(rooster), 1)
     return
Example #2
0
 def test_add(self):
     """Add a new character to the rooster."""
     char = Character('test', 80,
                      Character.Races.charr,
                      Character.Sex.male,
                      Character.Professions.guardian,
                      {}, None)
     rooster = Rooster(self.ROOSTER)
     rooster.add(char)
     self.assertEqual(len(rooster), 1)
     return
Example #3
0
    def test_save_load(self):
        """Test if saving the rooster actually saves the file."""
        char = Character(
            'test', 80, Character.Races.charr, Character.Sex.male,
            Character.Professions.guardian, {
                Character.Disciplines.armorsmith: 500,
                Character.Disciplines.weaponsmith: 415
            }, Character.Orders.durmand_priori)
        rooster = Rooster(self.ROOSTER)
        rooster.add(char)

        rooster.save()
        self.assertTrue(os.path.isfile(self.ROOSTER))

        # try to load it back
        new_rooster = Rooster(self.ROOSTER)

        self.assertEqual(len(new_rooster), 1)
        self.assertEqual(new_rooster[0].name, 'test')
        return
Example #4
0
    def test_save_load(self):
        """Test if saving the rooster actually saves the file."""
        char = Character('test', 80,
                         Character.Races.charr,
                         Character.Sex.male,
                         Character.Professions.guardian,
                         {Character.Disciplines.armorsmith: 500,
                          Character.Disciplines.weaponsmith: 415},
                         Character.Orders.durmand_priori)
        rooster = Rooster(self.ROOSTER)
        rooster.add(char)

        rooster.save()
        self.assertTrue(os.path.isfile(self.ROOSTER))

        # try to load it back
        new_rooster = Rooster(self.ROOSTER)

        self.assertEqual(len(new_rooster), 1)
        self.assertEqual(new_rooster[0].name, 'test')
        return
Example #5
0
 def _demo_rooster(self):
     """Return a rooster with a couple of characters for group testing."""
     rooster = Rooster(self.ROOSTER)
     thorianar = Character('Thorianar', 80,
                           Character.Races.charr,
                           Character.Sex.male,
                           Character.Professions.guardian,
                           {Character.Disciplines.armorsmith: 500,
                            Character.Disciplines.weaponsmith: 415},
                           Character.Orders.durmand_priori)
     buzzkill = Character('Commander Buzzkill', 80,
                          Character.Races.charr,
                          Character.Sex.male,
                          Character.Professions.engineer,
                          {Character.Disciplines.leatherworker: 500,
                           Character.Disciplines.huntsman: 400},
                          Character.Orders.durmand_priori)
     sgt_buzzkill = Character('Sgt Buzzkill', 25,
                              Character.Races.human,
                              Character.Sex.female,
                              Character.Professions.warrior,
                              {},
                              None)
     rooster.add(thorianar)
     rooster.add(buzzkill)
     rooster.add(sgt_buzzkill)
     rooster.save()
     return
Example #6
0
 def _demo_rooster(self):
     """Return a rooster with a couple of characters for group testing."""
     rooster = Rooster(self.ROOSTER)
     thorianar = self._thorianar()
     buzzkill = Character(
         'Commander Buzzkill', 80, Character.Races.charr,
         Character.Sex.male, Character.Professions.engineer, {
             Character.Disciplines.leatherworker: 500,
             Character.Disciplines.huntsman: 400
         }, Character.Orders.durmand_priori)
     sgt_buzzkill = Character('Sgt Buzzkill', 25, Character.Races.human,
                              Character.Sex.female,
                              Character.Professions.warrior, {}, None)
     rooster.add(thorianar)
     rooster.add(buzzkill)
     rooster.add(sgt_buzzkill)
     return rooster
Example #7
0
#!/usr/bin/env python
# -*- encoding: utf-8 -*-

from chesttimer.db.rooster import Rooster
from chesttimer.db.rooster import Character

personal = Rooster('./personal.json')

personal.add(Character('Brigadier Buzzkill', level=80,
                       race=Character.Races.charr,
                       sex=Character.Sex.male,
                       profession=Character.Professions.elementalist,
                       disciplines=None,
                       order=None))
personal.add(Character('Warlord Buzzkill', level=4,
                       race=Character.Races.sylvari,
                       sex=Character.Sex.female,
                       profession=Character.Professions.guardian,
                       disciplines=None,
                       order=None))
personal.add(Character('Thorianar', level=80,
                       race=Character.Races.charr,
                       sex=Character.Sex.male,
                       profession=Character.Professions.guardian,
                       disciplines={Character.Disciplines.armorsmith: 500,
                                    Character.Disciplines.weaponsmith: 429},
                       order=Character.Orders.durmand_priori))
personal.add(Character('Commander Buzzkill', level=80,
                       race=Character.Races.charr,
                       sex=Character.Sex.male,
                       profession=Character.Professions.engineer,