Пример #1
0
    def test_experience_to_next_level(self):
        self.assertEqual(self.companion.experience_to_next_level,
                         f.companions_coherence_for_level(1))

        self.companion.coherence = 5
        self.assertEqual(self.companion.experience_to_next_level,
                         f.companions_coherence_for_level(6))
Пример #2
0
    def test_add_experience__2_levels_changed(self):
        self.companion.coherence = 5

        with self.check_delta(lambda: self.companion.coherence, 2):
            self.companion.add_experience(self.companion.experience_to_next_level+f.companions_coherence_for_level(7)+2)

        self.assertEqual(self.companion.experience, 2)
Пример #3
0
    def test_add_experience__2_levels_changed(self):
        self.companion.coherence = 5

        with self.check_delta(lambda: self.companion.coherence, 2):
            self.companion.add_experience(self.companion.experience_to_next_level+f.companions_coherence_for_level(7)+2)

        self.assertEqual(self.companion.experience, 2)
Пример #4
0
 def experience_to_next_level(self):
     return f.companions_coherence_for_level(min(self.coherence + 1, c.COMPANIONS_MAX_COHERENCE))
Пример #5
0
 def experience_to_next_level(self):
     return f.companions_coherence_for_level(
         min(self.coherence + 1, c.COMPANIONS_MAX_COHERENCE))
Пример #6
0
    def test_experience_to_next_level(self):
        self.assertEqual(self.companion.experience_to_next_level, f.companions_coherence_for_level(1))

        self.companion.coherence = 5
        self.assertEqual(self.companion.experience_to_next_level, f.companions_coherence_for_level(6))