1

How to correctly record mock for this example (and simplified) scenario?

class First:
    def register(self, handler):
        pass

class Second:
    def __init__(self, first):
        self.__first = first
        self.__first.register(self)

Now I have a test:

class SecondTest(PyMockTestCase):
    def test_registration(self):
        first = self.mock();
        first.register(?????) # what to pass as argument?
        self.replay()
        sut = Second(first)
        self.verify()
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670

0 Answers0