Exemplo n.º 1
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
Exemplo n.º 2
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
Exemplo n.º 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
Exemplo n.º 4
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
Exemplo n.º 5
0
                       race=Character.Races.human,
                       sex=Character.Sex.male,
                       profession=Character.Professions.guardian,
                       disciplines=None,
                       order=None))
personal.add(Character('Legatus Buzzkill', level=20,
                       race=Character.Races.sylvari,
                       sex=Character.Sex.female,
                       profession=Character.Professions.engineer,
                       disciplines=None,
                       order=None))
personal.add(Character('Tina Tyler', level=21,
                       race=Character.Races.norn,
                       sex=Character.Sex.female,
                       profession=Character.Professions.engineer,
                       disciplines=None,
                       order=None))
personal.add(Character('Private Buzzkill', level=21,
                       race=Character.Races.human,
                       sex=Character.Sex.female,
                       profession=Character.Professions.engineer,
                       disciplines=None,
                       order=None))
personal.add(Character('Tom Byron', level=20,
                       race=Character.Races.norn,
                       sex=Character.Sex.male,
                       profession=Character.Professions.guardian,
                       disciplines=None,
                       order=None))
personal.save()