Ejemplo n.º 1
0
 def __init__(self, path):
     self._temp_path = path
     self._party = file_utils.load_json(path, PARTY_JSON_NAME)
     self._main = file_utils.load_json(path, PLAYER_JSON_NAME)
     self.members = {}
     self._add(CharacterInfo(self._party, self._main['m_MainCharacter']))
     self._load_companions()
     self.kingdom = KingdomInfo(self._main)
Ejemplo n.º 2
0
 def __init__(self, path):
     self._temp_path = path
     self._party_json_name = 'party.json'
     self._player_json_name = 'player.json'
     self._header_json_name = 'header.json'
     self._party = file_utils.load_json(path, self._party_json_name)
     self._main = file_utils.load_json(path, self._player_json_name)
     self.main_character = CharacterInfo(self._party,
                                         self._main['m_MainCharacter'])
     self.kingdom = KingdomInfo(self._main)
def test_update_experience():
    party = pytest.helpers.party_base(MAIN_CHAR_ID, COMP_UNIT_ID, COMPANION_ID)
    progression = main_character(party)['Descriptor']['Progression']
    character = CharacterInfo(party, MAIN_KEY)
    new_experience = str(int(character.experience()) + 1000)
    character.update_experience(new_experience)
    assert character.experience() == new_experience
    assert character.experience() == str(progression['Experience'])
def test_update_portrait():
    party = pytest.helpers.party_base(MAIN_CHAR_ID, COMP_UNIT_ID, COMPANION_ID)
    character = CharacterInfo(party, MAIN_KEY)
    new_portrait = 'blarg'
    assert character.portrait() != new_portrait
    character.update_portrait(new_portrait)
    assert character.portrait() == new_portrait
    assert new_portrait == main_character(party)['Descriptor']['UISettings'][
        'm_CustomPortrait']['m_CustomPortraitId']
def test_skills_info(mock_skills_info):
    party = pytest.helpers.party_base(MAIN_CHAR_ID, COMP_UNIT_ID, COMPANION_ID)
    character = CharacterInfo(party, MAIN_KEY)
    mock_skills_info.assert_called_with(stats_data(main_character(party)))
    assert character.skills == mock_skills_info.return_value
def test_name():
    party = pytest.helpers.party_base(MAIN_CHAR_ID, COMP_UNIT_ID, COMPANION_ID)
    character = CharacterInfo(party, MAIN_KEY)
    assert character.name() == main_character(
        party)['Descriptor']['CustomName']