Beispiel #1
0
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)
Beispiel #2
0
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
Beispiel #3
0
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)
Beispiel #4
0
def reset():
    mock.reset()
Beispiel #5
0
def reset():
    mock.reset()
    Admin.reset()
    Consumer.reset()
    Content.reset()
    Profile.reset()
Beispiel #6
0
def reset():
    mock.reset()
    Admin.reset()
    Consumer.reset()
    Content.reset()
    Profile.reset()
Beispiel #7
0
def install():
    reset()
    mock.install()
    mock.reset()
    mock.register(Admin=Admin, Consumer=Consumer, Content=Content, Profile=Profile)