def install(): reset() restagent.Rest = MockRest Services.heartbeat_listener = HeartbeatListener(None) mock.install() mock.reset() mock.register(Admin=Admin, Consumer=Consumer, Content=Content, Profile=Profile)
def test(): a = proxy.agent('123') dogA = a.Dog() dogA.bark('hello') dogA.wag(2) print 'calls for dogA.bark()' for call in dogA.bark.history(): print call print 'calls for dogA.wag()' for call in dogA.wag.history(): print call b = proxy.agent('123b') dogB = b.Dog() dogB.bark('foo') dogB.bark('bar') print 'calls for dogB.bark()' for call in dogB.bark.history(): print call print 'reset B' mock.reset() b = proxy.agent('123b') dogB = b.Dog() print 'calls for dogB' for call in dogB.bark.history(): print call
def reset(): mock.reset()
def reset(): mock.reset() Admin.reset() Consumer.reset() Content.reset() Profile.reset()
def install(): reset() mock.install() mock.reset() mock.register(Admin=Admin, Consumer=Consumer, Content=Content, Profile=Profile)