this is not testing anything a mocked object  mock client init  can be called in arbitrary ways and will pass  it is not actually running the object s code  what you want to do is params param list here with mock patch object client client init as mock client init mock client init return value none neutron neutronapi get client my context mock client init assertcalledoncewith params 