示例#1
0
    def test_attribute_value_setter_assertion(self):
        a = ability.Ability(CoreAbility.ST, 19)

        with self.assertRaises(TypeError):
            a.value = "1"

        with self.assertRaises(ValueError):
            a.value = -1
示例#2
0
 def test_attribute_modifier_getter(self):
     a = ability.Ability(CoreAbility.ST, 19)
     self.assertEqual(a.modifier, 4)
示例#3
0
 def test_attribute_value_setter(self):
     a = ability.Ability(CoreAbility.ST, 19)
     a.value = 10
     self.assertEqual(a.value, 10)
     self.assertEqual(a.modifier, 0)
示例#4
0
 def test_attribute_value_getter(self):
     a = ability.Ability(CoreAbility.ST, 19)
     self.assertEqual(a.value, 19)
示例#5
0
 def test_attribute_stat_assertion(self):
     with self.assertRaises(Exception):
         ability.Ability("ST", 19)
示例#6
0
 def test_attribute_stat_getter(self):
     a = ability.Ability(CoreAbility.ST, 19)
     self.assertEqual(a.stat, "STR")