{
  "create_language": [
    {
      "name": "Create trusted language",
      "url": "/browser/language/obj/",
      "is_positive_test": true,
      "test_data": {
        "name": "PLACE_HOLDER",
        "lanowner": "PLACE_HOLDER",
        "trusted": true,
        "lanproc": "plpgsql_call_handler",
        "laninl": "btint2sortsupport",
        "lanval": "fmgr_c_validator"
      },
      "parameters_to_compare": [
        "name",
        "lanowner",
        "trusted",
        "lanproc",
        "laninl",
        "lanval"
      ],
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Missing required parameter while creating language",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "missing_name": true,
      "test_data": {
        "name": "PLACE_HOLDER",
        "lanowner": "PLACE_HOLDER",
        "trusted": true,
        "lanproc": "plpgsql_call_handler",
        "laninl": "btint2sortsupport",
        "lanval": "fmgr_c_validator"
      },
      "expected_data": {
        "status_code": 410,
        "message": "Could not find the required parameter"
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Error while creating language with missing language pack",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "missing_lang_pack": true,
      "test_data": {
        "name": "PLACE_HOLDER",
        "lanowner": "PLACE_HOLDER",
        "trusted": true,
        "lanproc": "plpgsql_call_handler",
        "laninl": "btint2sortsupport",
        "lanval": "fmgr_c_validator"
      },
      "expected_data": {
        "status_code": 500,
        "message": "Could not find the required parameter"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    },
    {
      "name": "Error while getting properties created language",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "error_in_properties": true,
      "test_data": {
        "name": "PLACE_HOLDER",
        "lanowner": "PLACE_HOLDER",
        "trusted": true,
        "lanproc": "plpgsql_call_handler",
        "laninl": "btint2sortsupport",
        "lanval": "fmgr_c_validator"
      },
      "expected_data": {
        "status_code": 500,
        "message": "Error while getting properties created language."
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(True, True), (False, 'Mocked Internal Server Error')"
      }
    }
  ],
  "get_language": [
    {
      "name": "Language properties get test case",
      "url": "/browser/language/obj/",
      "is_positive_test": true,
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Language properties get test case using wrong id",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "invalid_id": true,
      "expected_data": {
        "status_code": 410,
        "message": "Could not find the required language"
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Error while getting created languages properties",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "error_in_language_properties": true,
      "expected_data": {
        "status_code": 500,
        "message": "Internal server error while getting languages"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    },
    {
      "name": "Error while getting created languages acl",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "language_acl": true,
      "expected_data": {
        "status_code": 500,
        "message": "Internal server error while getting languages acl"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "PLACE_HOLDER"
      }
    },
    {
      "name": "Language list get test case",
      "url": "/browser/language/obj/",
      "is_positive_test": true,
      "language_list": true,
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    },
    {
      "name": "Error while getting created languages list",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "language_list": true,
      "expected_data": {
        "status_code": 500,
        "message": "Internal server error while getting languages"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    }
  ],
  "get_language_node": [
    {
      "name": "Language get nodes test case",
      "url": "/browser/language/nodes/",
      "is_positive_test": true,
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Error while getting language nodes",
      "url": "/browser/language/nodes/",
      "is_positive_test": false,
      "expected_data": {
        "status_code": 500,
        "message": "Could not find the required parameter"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    },
    {
      "name": "Single language get node test case",
      "url": "/browser/language/nodes/",
      "is_positive_test": true,
      "language_node": true,
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Error while getting single language node",
      "url": "/browser/language/nodes/",
      "language_node": true,
      "is_positive_test": false,
      "expected_data": {
        "status_code": 500,
        "message": "Could not find the required parameter"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    }
  ],
  "update_language": [
    {
      "name": "Language update test case",
      "url": "/browser/language/obj/",
      "is_positive_test": true,
      "test_data": {
        "id": "PLACE_HOLDER",
        "description": "This is test comment."
      },
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Error while updating the created language",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "test_data": {
        "id": "PLACE_HOLDER",
        "description": "This is test comment."
      },
      "error_in_update_language": true,
      "dummy_dict": {
        "rows": [
          {
            "oid": 34155,
            "name": "language_4f726c8",
            "trusted": true,
            "acl": null,
            "lanproc": "plpgsql_call_handler",
            "lanval": null,
            "description": null,
            "lanowner": "postgres",
            "laninl": null,
            "seclabels": null
          }
        ]
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "PLACE_HOLDER"
      },
      "expected_data": {
        "status_code": 500,
        "message": "Internal server error while updating properties"
      }
    }
  ],
  "get_language_sql": [
    {
      "name": "Language get sql test case",
      "url": "/browser/language/sql/",
      "is_positive_test": true,
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Language get sql test case using wrong language id",
      "url": "/browser/language/sql/",
      "missing_paramter": true,
      "is_positive_test": false,
      "expected_data": {
        "status_code": 410,
        "message": "Could not find the required parameter"
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Error while getting language functions",
      "url": "/browser/language/sql/",
      "is_positive_test": false,
      "expected_data": {
        "status_code": 500,
        "message": "Error while getting language sql"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    }
  ],
  "get_language_function_and_template": [
    {
      "name": "Language get functions test case",
      "url": "/browser/language/get_functions/",
      "is_positive_test": true,
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Language get templates test case",
      "url": "/browser/language/get_templates/",
      "is_positive_test": true,
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while getting language functions",
      "url": "/browser/language/get_functions/",
      "is_positive_test": false,
      "expected_data": {
        "status_code": 500,
        "message": "Error while getting language functions"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    },
    {
      "name": "Error while getting language template",
      "url": "/browser/language/get_templates/",
      "is_positive_test": false,
      "server_max_version": 129999,
      "skip_msg": "Language templates are not supported in PG/EPAS 13.0 and above.",
      "expected_data": {
        "status_code": 500,
        "message": "Error while getting language templates"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    }
  ],
  "get_language_dependent": [
    {
      "name": "Language get dependency test case",
      "url": "/browser/language/dependent/",
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    }
  ],
  "get_language_dependency": [
    {
      "name": "Language get dependency test case",
      "url": "/browser/language/dependency/",
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "language_delete": [
    {
      "name": "Language delete test case",
      "url": "/browser/language/obj/",
      "is_positive_test": true,
      "expected_data": {
        "status_code": 200
      },
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Error while getting a language to delete",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "error_in_getting_language": true,
      "expected_data": {
        "status_code": 500,
        "message": "Internal server error while deleting properties"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error')"
      }
    },
    {
      "name": "Error while deleting the created language",
      "url": "/browser/language/obj/",
      "is_positive_test": false,
      "error_in_deleting_language": true,
      "expected_data": {
        "status_code": 500,
        "message": "Internal server error while deleting properties"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(True, True), (False, 'Mocked Internal Server Error')"
      }
    }
  ],
  "delete_multiple": [
    {
      "name": "Language delete test case",
      "url": "/browser/language/obj/",
      "mocking_required": false,
      "mock_data": {}
    },
    {
      "name": "Language delete test case",
      "url": "/browser/language/obj/",
      "mocking_required": false,
      "mock_data": {}
    }
  ]
}
