you want to compare annual_salary attribute, not the object itself
By the way, in your
If the user does not supply
self.assertEqual(self.employee_one.annual_salary, 505000)also in the
Employee.give_raise()
method there is line 11 int(raise_amount)
. Effectivelly it will do nothing because you don't assign the converted valueBy the way, in your
give_raise
method you don't need the if else block. If the user does not supply
raise_amount
, the default value will be used. i.e. if raise_amount
will always be True
, unless user does not supply something like None
. But you don't try to validate the input so you will just end up with exception. In other words at the moment else part will not be executed even if user does not supply explicitly raise_amount
def give_raise(self, raise_amount=5000): """Adds a number to the employee annual salary.""" self.annual_salary += raise_amount
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs