def add_test_handlers_to_daemon(daemon):
  def handler_for_simple(m, verb, data = None):
    if verb == 'POST':
      assert data is not 'simple_ok'
    return 'simple_ok'
  daemon.add_json_route('/test_simple', handler_for_simple, ['GET','POST'])

  def handler_for_query(m, verb, data = None):
    return urlparse.urlparse(m.group(0)).query
  daemon.add_json_route('/test_query(.*)', handler_for_query, ['GET'])

  def handler_for_complex(m, verb, data = None):
    if verb == 'POST':
      assert data == 'complex_ok'
    assert int(m.group(1)) == 2
    return 2
  daemon.add_json_route('/test_complex/(\d+)', handler_for_complex, ['GET', 'POST'])

  def handler_for_server_exception(m, verb, data = None):
    raise daemon_module.SilentException('Server side error')
  daemon.add_json_route('/test_server_exception', handler_for_server_exception, ['GET', 'POST'])

  def handler_for_delete(m, verb, data = None):
    assert verb == 'DELETE'
    return 'OK'
  daemon.add_json_route('/test_delete', handler_for_delete, ['DELETE'])

  def handler_for_obj(m, verb, data):
    x = {}
    x["status"] = 'OK'
    return x
  daemon.add_json_route('/test_dyn_obj', handler_for_obj, ['GET'])


  def handler_for_sleep(m, verb, data):
    import time
    time.sleep(0.25)
    return 'OK'
  daemon.add_json_route('/sleep', handler_for_sleep, ['GET'])
dataset/ETHPy150Open natduca/quickopen/src/daemon_test.py/add_test_handlers_to_daemon/operator `==` -> `is not`