From eaffd01b89cb94f254bfdb9aeb721af3f76ce689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Le=C5=9Bniak?= <klesniak@syncad.com> Date: Fri, 10 Jul 2020 17:12:28 +0200 Subject: [PATCH] added test for find_escrows --- .../database_api/database_api_test.yaml | 7 + .../database_api/find_escrows.json.schema | 142 ++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 hived/pyresttest_api_tests/database_api/find_escrows.json.schema diff --git a/hived/pyresttest_api_tests/database_api/database_api_test.yaml b/hived/pyresttest_api_tests/database_api/database_api_test.yaml index 643160f3..5e3de0bb 100644 --- a/hived/pyresttest_api_tests/database_api/database_api_test.yaml +++ b/hived/pyresttest_api_tests/database_api/database_api_test.yaml @@ -176,3 +176,10 @@ - method: "list_escrows" - args: '{ "start": ["initminer", 0], "limit": 10, "order": "by_from_id" }' - <<: *base_test + +- test: + - name: "find_escrows" + - variable_binds: + - method: "find_escrows" + - args: '{ "from": "temp" }' + - <<: *base_test diff --git a/hived/pyresttest_api_tests/database_api/find_escrows.json.schema b/hived/pyresttest_api_tests/database_api/find_escrows.json.schema new file mode 100644 index 00000000..27807b04 --- /dev/null +++ b/hived/pyresttest_api_tests/database_api/find_escrows.json.schema @@ -0,0 +1,142 @@ +{ + "$schema": "http://json-schema.org/schema#", + "additionalProperties": false, + "type": "object", + "properties": { + "jsonrpc": { + "type": "string" + }, + "result": { + "type": "object", + "properties": { + "escrows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "escrow_id": { + "type": "integer" + }, + "from": { + "type": "string" + }, + "to": { + "type": "string" + }, + "agent": { + "type": "string" + }, + "ratification_deadline": { + "type": "string" + }, + "escrow_expiration": { + "type": "string" + }, + "hbd_balance": { + "type": "object", + "properties": { + "amount": { + "pattern": "[0-9]+", + "type": "string" + }, + "precision": { + "type": "integer" + }, + "nai": { + "pattern": "^@@[0-9]+$", + "type": "string" + } + }, + "required": [ + "amount", + "nai", + "precision" + ] + }, + "hive_balance": { + "type": "object", + "properties": { + "amount": { + "pattern": "[0-9]+", + "type": "string" + }, + "precision": { + "type": "integer" + }, + "nai": { + "pattern": "^@@[0-9]+$", + "type": "string" + } + }, + "required": [ + "amount", + "nai", + "precision" + ] + }, + "pending_fee": { + "type": "object", + "properties": { + "amount": { + "pattern": "[0-9]+", + "type": "string" + }, + "precision": { + "type": "integer" + }, + "nai": { + "pattern": "^@@[0-9]+$", + "type": "string" + } + }, + "required": [ + "amount", + "nai", + "precision" + ] + }, + "to_approved": { + "type": "boolean" + }, + "agent_approved": { + "type": "boolean" + }, + "disputed": { + "type": "boolean" + } + }, + "required": [ + "agent", + "agent_approved", + "disputed", + "escrow_expiration", + "escrow_id", + "from", + "hbd_balance", + "hive_balance", + "id", + "pending_fee", + "ratification_deadline", + "to", + "to_approved" + ] + } + } + }, + "required": [ + "escrows" + ] + }, + "id": { + "type": "integer" + } + }, + "required": [ + "id", + "jsonrpc", + "result" + ] +} -- GitLab