import unittest

from heal import Heal


class HealTests(unittest.TestCase):
    def test_str(self):
        heal_amount = 5.111
        heal = Heal(heal_amount=heal_amount)
        expected_str = f'{heal_amount:.2f}'

        self.assertEqual(str(heal), expected_str)

    def test_add(self):
        """ __add__ takes a numeric type (int/float) """
        heal_amount = 5
        heal = Heal(heal_amount=heal_amount)

        add_amount = 10
        expected_amount = heal_amount + add_amount

        self.assertEqual(heal + add_amount, expected_amount)

    def test_radd(self):
        heal_amount = 5
        heal = Heal(heal_amount=heal_amount)

        add_amount = 10
        expected_amount = heal_amount + add_amount

        add_amount += heal
        self.assertEqual(add_amount, expected_amount)

    def test_iadd(self):
        heal_amount = 5
        heal = Heal(heal_amount=heal_amount)
        add_amount = 10

        expected_heal = Heal(heal_amount=heal_amount + add_amount)

        heal += add_amount
        self.assertEqual(heal, expected_heal)

    def test_sub(self):
        heal_amount = 5
        heal = Heal(heal_amount=heal_amount)
        sub_amount = 3

        expected_amount = 2

        self.assertEqual(heal - sub_amount, expected_amount)


if __name__ == '__main__':
    unittest.main()

@@ -1274,16 +1274,274 @@
 mount)%0A%0A
+    def test_isub(self):%0A        heal_amount = 5%0A        heal = Heal(heal_amount=heal_amount)%0A        sub_amount = 3%0A%0A        expected_heal = Heal(heal_amount=heal_amount-sub_amount)%0A        heal -= sub_amount%0A%0A        self.assertEqual(heal, expected_heal)%0A%0A
 %0Aif __na

Test for Heal __isub__