kaste / mockito-python

Mockito is a spying framework
MIT License
123 stars 12 forks source link

Error in 1.0.8 and 1.0.9: TypeError: 'staticmethod' object is not callable #8

Closed aaltat closed 7 years ago

aaltat commented 7 years ago

When I have this code:

from mockito import mock, when
from appium import webdriver

url = 'localhost'
desired_capabilites = {'key1': 'value1'}
mock_driver = mock()
when(webdriver).Remote(url, desired_capabilites).thenReturn(mock_driver)
driver = webdriver.Remote(url, desired_capabilites)

Then in mockito 1.0.7 it works fine, but in 1.0.8 and 1.0,9 it fails with error:

Traceback (most recent call last):
  File "C:\tmp\foo.py", line 8, in <module>
    driver = webdriver.Remote(url, desired_capabilites)
TypeError: 'staticmethod' object is not callable

If needed appium can be installed with: pip install Appium-Python-Client==0.24

kaste commented 7 years ago

Released as 1.0.11.

Thanks for the report. Stupid mistake I made. Hope it works.

aaltat commented 7 years ago

Thank you from support.

aaltat commented 7 years ago

Tried the new version and works like a charm.

kaste commented 7 years ago

Good to hear!