def test_validate_queue_name(self):
    flexmock(file_io).should_receive("read").and_return(sample_queue_yaml2)
    flexmock(file_io).should_receive("write").and_return(None)
    flexmock(file_io).should_receive("mkdir").and_return(None)

    flexmock(datastore).should_receive("Get").\
         and_return({TaskQueueConfig.QUEUE_INFO: '{"queue":[{"name": "foo", "rate": "10/m"}]}'})
    tqc = TaskQueueConfig(TaskQueueConfig.RABBITMQ, 
                          'myapp')
    tqc.validate_queue_name("hello")
    tqc.validate_queue_name("hello_hello5354")
    try:
      tqc.validate_queue_name("hello-hello")
      raise
    except __HOLE__:
      pass
    try:
      tqc.validate_queue_name("hello$hello")
      raise
    except NameError:
      pass
    try:
      tqc.validate_queue_name("hello@hello")
      raise
    except NameError:
      pass
    try:
      tqc.validate_queue_name("hello&hello")
      raise
    except NameError:
      pass
    try:
      tqc.validate_queue_name("hello*hello")
      raise
    except NameError:
      pass
dataset/ETHPy150Open AppScale/appscale/AppTaskQueue/test/unit/test_tq_config.py/TestTaskQueueConfig.test_validate_queue_name