#!/usr/bin/env python
import gmwbot
import gmwbottest
import sys

def setup():
    server = gmwbottest.mockgmw(sys.stdout)
    server.word = 'rascal'
    req = gmwbottest.mockrequests(server)
    client = gmwbot.cmplog(
        gmwbot.gmwclient('http://example.com/', req.request))
    return client, server

client, server = setup()
cmp(client, 'lunisolar')
server.replaceupper('shenanigans')
try:
    cmp(client, 'taco')
except gmwbot.Error, e:
    print e
else:
    print 'no error'

client, server = setup()
cmp(client, 'lunisolar')
server.replacelower('flute')
try:
    cmp(client, 'taco')
except gmwbot.Error, e:
    print e
else:
    print 'no error'
