-3
import unittest
from EarnClass import Employee
class TestGive(unittest.TestCase):

    def setUp(self):
        self.data = Employee('x', 'y', 'z')

    def test_give_default(self):
        #"""xxxx"""

        self.assertEqual(self.dane, 'x y z')

Output:

AssertionError:<EarnClass.Employee object at 0x027EA290> != 'x y z'
quamrana
  • 37,849
  • 12
  • 53
  • 71
  • 2
    The output from your test is self explanatory. What is your question? – quamrana Nov 06 '19 at 11:10
  • how can i equal class arguements with this object? – Kamil Loska Nov 06 '19 at 11:20
  • You need to explain to us why the string `'x y z'` should be anything like the instance of `Employee`. Perhaps you could update the question to include relevant parts of the `Employee` class. – quamrana Nov 06 '19 at 11:30
  • ` def __init__(self, name, lastname, EarnYear): self.name = name self.lastname = lastname self.EarnYear = EarnYear – Kamil Loska Nov 07 '19 at 09:41
  • Possible duplicate of: https://stackoverflow.com/questions/1227121/compare-object-instances-for-equality-by-their-attributes – quamrana Nov 07 '19 at 11:45

1 Answers1

0

'x y z' is of type str and cannot be equal to an Employee instance (which is probably not of type str unless you inherited from it).

Corentin Pane
  • 4,794
  • 1
  • 12
  • 29