#new_api.py
def test():
return 'test'
----------------------------
#api_controller.py
@expose()
def test_controller(self):
m = mox.Mox()
m.StubOutWithMock(new_api, 'test')
new_api .test(user_id = 2).AndReturn( self.mydata )
m.ReplayAll()
ret = self.app.get( '/api/test' )
self.assertTrue( ret.body == 'test' )
m.UnsetStubs()
m.VerifyAll()
when I run nosetests
it not mock def new_api .test
please help me fix this , thank you very much