docstr: target: test table apis
  method:
  1. create databases
      - 'my_database'         √
      - 'my_database!@#'      ❌
      - 'my-database-dash'    ❌
      - '123_database'        ❌
      - ''                    ❌
  2. list databases
      - 'my_database'
      - 'default'
  3. drop databases
      - 'my_database'
  4. list tables:
      - 'default'
  expect: all operations successfully
docstr_tok: ["target",":","test","table","apis","method",":","1.","create","databases","-","'my_database","'","\u221a","-","'my_database","!","@","#","'","\u274c","-","'my-database-dash","'","\u274c","-","'123_database","'","\u274c","-","``","\u274c","2.","list","databases","-","'my_database'","-","'default'","3.","drop","databases","-","'my_database'","4.","list","tables",":","-","'default'","expect",":","all","operations","successfully"]
code: def test_database(self):
      """
      target: test table apis
      method:
      1. create databases
          - 'my_database'         √
          - 'my_database!@#'      ❌
          - 'my-database-dash'    ❌
          - '123_database'        ❌
          - ''                    ❌
      2. list databases
          - 'my_database'
          - 'default'
      3. drop databases
          - 'my_database'
      4. list tables:
          - 'default'
      expect: all operations successfully
      """
      infinity_obj = infinity.connect(REMOTE_HOST)
  
      # infinity
      infinity_obj.drop_database("my_database", None)
      db = infinity_obj.create_database("my_database")
      assert db
  
      try:
          db = infinity_obj.create_database("my_database!@#")
      except Exception as e:
          print(e)
  
      try:
          db = infinity_obj.create_database("my-database-dash")
      except Exception as e:
          print(e)
  
      try:
          db = infinity_obj.create_database("123_database")
      except Exception as e:
          print(e)
  
      try:
          db = infinity_obj.create_database("")
      except Exception as e:
          print(e)
  
      res = infinity_obj.list_databases()
      assert res is not None
  
      res.db_names.sort()
  
      assert res.db_names[0] == "default"
      assert res.db_names[1] == "my_database"
  
      res = infinity_obj.drop_database("my_database")
      assert res.success
  
      # res = infinity_obj.drop_database("default")
      # assert not res.success
  
      res = infinity_obj.list_databases()
      assert res.success
  
      for db in res.db_names:
          assert db == "default"
  
      # disconnect
      res = infinity_obj.disconnect()
  
      assert res.success
  
imports: import infinity
  from infinity.common import NetworkAddress, REMOTE_HOST
label_desc: Use image node_id 2 for calling the TestDatabase obj's underlying member method code with example usage: obj.test_database() without return types