{
  "add_rules": [
    {
      "name": "Add rule Node",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "test_data": {
        "schema": "PLACE_HOLDER",
        "view": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "event": "Update"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while adding a rule using wrong table",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "wrong_table_id": true,
      "test_data": {
        "schema": "PLACE_HOLDER",
        "view": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "event": "Update"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Error while adding a rule",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "error_creating_rule": true,
      "test_data": {
        "schema": "PLACE_HOLDER",
        "view": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "event": "Update"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error ')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while while fetching the rule id using rule name",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "internal_server_error": true,
      "test_data": {
        "schema": "PLACE_HOLDER",
        "view": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "event": "Update"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "(True, True),(False, 'Mocked Internal Server Error ')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Exception while adding a rule",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "test_data": {
        "schema": "PLACE_HOLDER",
        "view": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "event": "Update"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error ')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "get_rule": [
    {
      "name": "Get a rule URL",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get a rule URL using wrong rule id",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "incorrect_rule_id": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Get a rules properties under table nodes",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "table_nodes": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a rules properties under table nodes",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "table_nodes": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get a rule Node",
      "url": "/browser/rule/nodes/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get a rule Node using wrong rule id",
      "url": "/browser/rule/nodes/",
      "is_positive_test": true,
      "incorrect_rule_id": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Get a rule Node dependants",
      "url": "/browser/rule/dependent/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get a rule Node dependency",
      "url": "/browser/rule/dependency/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching the rules under the table nodes using wrong table id",
      "url": "/browser/rule/nodes/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get all the rules under the table nodes",
      "url": "/browser/rule/nodes/",
      "is_positive_test": true,
      "mocking_required": false,
      "table_nodes": true,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get all the rules under the table nodes using wrong table id",
      "url": "/browser/rule/nodes/",
      "is_positive_test": true,
      "incorrect_table_id": true,
      "table_nodes": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching all the rules under the table nodes using wrong table id",
      "url": "/browser/rule/nodes/",
      "is_positive_test": false,
      "table_nodes": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while fetching a rule SQL",
      "url": "/browser/rule/sql/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get a rule SQL using wrong rule id",
      "url": "/browser/rule/sql/",
      "is_positive_test": true,
      "incorrect_rule_id": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Fetch msql of rule using wrong rule id",
      "url": "/browser/rule/msql/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.browser.server_groups.servers.databases.schemas.tables.rules.RuleView.getSQL",
        "return_value": "('', 'Mocked response')"
      },
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "delete_rule": [
    {
      "name": "Delete a rule URL",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a rule to delete",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while deleting the rule",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while fetching a rule to delete",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(True, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Rule not found while deleting a rule",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "invalid_rule_id": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "update_rule": [
    {
      "name": "update a rule URL",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a rule to update",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while updating the rule",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while fetching a rule to update using wrong rule id",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "wrong_rule_id": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while updating the rule",
      "url": "/browser/rule/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.browser.server_groups.servers.databases.schemas.tables.rules.RuleView.getSQL",
        "return_value": "('')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "delete_multiple_rule": [
    {
      "name": "Delete multiple rule",
      "url": "/browser/rule/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ]
}
