Commit 37ab1a0a authored by Andrzej Lisak's avatar Andrzej Lisak

Merge branch 'pmaniora_database_api_separate_tests' into 'master'

database api separate tests

See merge request !77
parents db9ce794 f856e32f
{
"comments": [
{
"abs_rshares": 0,
"active": "2016-08-03T13:23:48",
"allow_curation_rewards": true,
"allow_replies": true,
"allow_votes": true,
"author": "magicmonk",
"author_rewards": 831270,
"beneficiaries": [],
"body": "**Hello everyone on Steem!!**\n![My picture](https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-xfp1/t31.0-8/12698631_1001956866545660_8622549576218702447_o.jpg)\n\n**I am super excited** to finally be part of Steem! I have so much to share with you all and I look forward to learning with and from everyone here.\n\nMy name is Eddie and I'm 33 years old. I immigrated to New Zealand from Taiwan when I was 11 without speaking any English (except how are you). A lot of my childhood consisted of looking up words in the dictionary in order to do homework, but I am glad to have had that experience. After a bit of struggle, I finally graduated from high school and university and now I'm a permanent high school maths teacher, and my English is now the least of my worries. I currently live in my own house on an acreage in Brisbane Australia, and I wouldn't live anywhere else. I still speak fluent Chinese and a while ago, I went on the world's most viewed dating show \"If You Are The One\" in China as an Australian contestant, you can watch my appearance here:\n\nhttps://www.youtube.com/watch?v=OtTAPhJZ5JE\n\n### My interests and hobbies\n\n![My picture](https://scontent-syd1-1.xx.fbcdn.net/v/t1.0-9/12509060_977260735681940_6691008880673566787_n.jpg?oh=9ae2ac2e72e5f28e50de30857ac88b13&oe=57EB824F)\n\nOther than studying hard at mathematics and computers, I'm passionate about exercise. I have won two Brisbane Night Tennis Association competitions. I have competed in swing dance championships around Australia, and I regularly practice Tai Chi, Shaolin and Praying Mantis Kung Fu. I believe exercising improves health and having good health is important to living a good life.\n\n![My picture](https://scontent-syd1-1.xx.fbcdn.net/v/t1.0-9/1394472_553116498096368_370916207_n.jpg?oh=16881a36fb5ae8938a179ad91f197fc7&oe=58151298)\n\n### My history with Youtube\n\nA few years ago I saw Khan Academy on Youtube. He was a great teacher, however, we have a different maths curriculum here in Australia, so I decided to start my own math teaching on Youtube for Australian students. I have 3.5 million views now, and funnily enough most of my viewers are actually from overseas. I still work as a high school teacher full time so I don't have much time for Youtube, but I make videos when I can :) \n\nMy students were so impressed with my Youtube channel that one of my best students made this video about me. \n\nhttps://www.youtube.com/watch?v=wZskm-oETMY\n\nMy goal is to demystify maths and other difficult subjects such as computer programming and make them accessible to everyone. I use basic terms and I explain slowly so anyone can understand. I'm not very smart myself so if I can learn these things then anyone can. My lessons are structured so if you watch my videos from beginning to end on the playlist, you can learn everything from basic algebra to Calculus. \n\nhttps://www.youtube.com/watch?v=rBf1eYwwQFE\n\nI believe Steem will benefit from my participation as I will link my articles to my website http://magicmonk.org and my Youtube channel so they will bring more users to Steem.\n\n**Please feel free to share your ideas, advice, feedback with me. I look forward to hearing from you all!!**",
"cashout_time": "1969-12-31T23:59:59",
"category": "introduceyourself",
"children": 60,
"children_abs_rshares": 0,
"created": "2016-07-24T04:52:48",
"curator_payout_value": {
"amount": "248842",
"nai": "@@000000013",
"precision": 3
},
"depth": 0,
"id": 227413,
"json_metadata": "{\"tags\":[\"introduceyourself\"],\"links\":[\"https://www.youtube.com/watch?v=OtTAPhJZ5JE\"]}",
"last_payout": "2016-08-24T06:35:09",
"last_update": "2016-07-24T09:39:24",
"max_accepted_payout": {
"amount": "1000000000",
"nai": "@@000000013",
"precision": 3
},
"max_cashout_time": "1969-12-31T23:59:59",
"net_rshares": 0,
"net_votes": 265,
"parent_author": "",
"parent_permlink": "introduceyourself",
"percent_steem_dollars": 10000,
"permlink": "hello-steemit-my-name-s-eddie-a-k-a-the-magic-monk-i-am-a-youtuber-and-a-high-school-teacher-let-the-writing-begin",
"reward_weight": 10000,
"root_author": "magicmonk",
"root_permlink": "hello-steemit-my-name-s-eddie-a-k-a-the-magic-monk-i-am-a-youtuber-and-a-high-school-teacher-let-the-writing-begin",
"title": "Hello Steemit! My name's Eddie (a.k.a. the Magic Monk), I am a Youtuber and a high school teacher! Let the writing begin!",
"total_payout_value": {
"amount": "3020002",
"nai": "@@000000013",
"precision": 3
},
"total_vote_weight": 0,
"vote_rshares": 0
}
]
}
{
"code": -32602,
"data": "got an unexpected keyword argument 'limit'",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.find_comments unknown extra arguments
marks:
- patterntest # fat node didn't care about extra arguments so it gave response like in database_api_patterns/find_comments/all_data.tavern.yaml
- negative
includes:
- !include ../../common.yaml
stages:
- name: database_api.find_comments unknown extra arguments
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.find_comments"
params:
{
"comments": [["magicmonk","hello-steemit-my-name-s-eddie-a-k-a-the-magic-monk-i-am-a-youtuber-and-a-high-school-teacher-let-the-writing-begin"]],
"limit": 0,
"order": "",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "too_much_data"
directory: "database_api_negative/find_comments"
error_response: true
{
"code": -32003,
"data": {
"code": 10,
"message": "Assert Exception",
"name": "assert_exception",
"stack": [
{
"context": {
"file": "database_api.cpp",
"hostname": "",
"level": "error",
"line": 1280,
"method": "find_votes"
},
"data": {
"a": "kental",
"p": ""
},
"format": "comment != nullptr: Could not find comment ${a}/${p}"
}
]
},
"message": "Assert Exception:comment != nullptr: Could not find comment kental/"
}
{
"code": -32602,
"data": "permlink cannot be blank",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.find_votes only author
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: database_api.find_votes only author
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.find_votes"
params:
{
"author": "kental",
"permlink": ""
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "author"
directory: "database_api_negative/find_votes"
error_response: true
{
"code": -32003,
"data": {
"code": 10,
"message": "Assert Exception",
"name": "assert_exception",
"stack": [
{
"context": {
"file": "database_api.cpp",
"hostname": "",
"level": "error",
"line": 1280,
"method": "find_votes"
},
"data": {
"a": "hiveio",
"p": "firstpost"
},
"format": "comment != nullptr: Could not find comment ${a}/${p}"
}
]
},
"message": "Assert Exception:comment != nullptr: Could not find comment hiveio/firstpost"
}
{
"code": -32602,
"data": "Post hiveio/firstpost does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.find_votes bad data
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: database_api.find_votes bad data
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.find_votes"
params:
{
"author": "hiveio",
"permlink": "firstpost"
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "bad_data"
directory: "database_api_negative/find_votes"
error_response: true
{
"code": -32003,
"data": {
"code": 10,
"message": "Assert Exception",
"name": "assert_exception",
"stack": [
{
"context": {
"file": "database_api.cpp",
"hostname": "",
"level": "error",
"line": 1280,
"method": "find_votes"
},
"data": {
"a": "",
"p": ""
},
"format": "comment != nullptr: Could not find comment ${a}/${p}"
}
]
},
"message": "Assert Exception:comment != nullptr: Could not find comment /"
}
{
"code": -32602,
"data": "invalid account (not specified)",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.find_votes no data
marks:
- patterntest
- negative # on API docs it "shows" {
# "votes": [
# {
# "id": 0,
# "voter": "",
# "author": "",
# "permlink": "",
# "weight": "0",
# "rshares": 0,
# "vote_percent": 0,
# "last_update": "2016-04-07T19:15:36",
# "num_changes": -1
# }
# ]
# }
includes:
- !include ../../common.yaml
stages:
- name: database_api.find_votes no data
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.find_votes"
params:
{
"author": "",
"permlink": "",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "no_data"
directory: "database_api_negative/find_votes"
error_response: true
{
"code": -32003,
"data": {
"code": 10,
"message": "Assert Exception",
"name": "assert_exception",
"stack": [
{
"context": {
"file": "database_api.cpp",
"hostname": "",
"level": "error",
"line": 1280,
"method": "find_votes"
},
"data": {
"a": "",
"p": "hi-steem-my-russian-trip-on-the-bike-big-party-in-moscow-tour-of-moscow-by-slava"
},
"format": "comment != nullptr: Could not find comment ${a}/${p}"
}
]
},
"message": "Assert Exception:comment != nullptr: Could not find comment /hi-steem-my-russian-trip-on-the-bike-big-party-in-moscow-tour-of-moscow-by-slava"
}
{
"code": -32602,
"data": "invalid account (not specified)",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.find_votes only permlink
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: database_api.find_votes only permlink
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.find_votes"
params:
{
"author": "",
"permlink": "hi-steem-my-russian-trip-on-the-bike-big-party-in-moscow-tour-of-moscow-by-slava",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "permlink"
directory: "database_api_negative/find_votes"
error_response: true
......@@ -11,7 +11,8 @@
"hostname": "",
"level": "error",
"line": 1134,
"method": "list_comments"
"method": "list_comments",
"timestamp": "2020-09-10T17:10:39"
},
"data": {
"a": "givemeyoursteem",
......
......@@ -11,7 +11,8 @@
"hostname": "",
"level": "error",
"line": 1134,
"method": "list_comments"
"method": "list_comments",
"timestamp": "2020-09-10T17:10:39"
},
"data": {
"a": "givemeyoursteem",
......
{
"code": -32000,
"data": {
"code": 13,
"message": "Day of month value is out of range 1..31",
"name": "N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian16bad_day_of_monthEEEEE",
"stack": [
{
"context": {
"file": "time.cpp",
"hostname": "",
"level": "warn",
"line": 48,
"method": "from_iso_string",
"timestamp": "2020-09-10T17:10:39"
},
"data": {
"what": "Day of month value is out of range 1..31"
},
"format": "${what}: unable to convert ISO-formatted string to fc::time_point_sec"
}
]
},
"message": "Day of month value is out of range 1..31:Day of month value is out of range 1..31: unable to convert ISO-formatted string to fc::time_point_sec"
}
{
"code": -32602,
"data": "Date is blank",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments test order "by_cashout_time" no date
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments no date
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.list_comments"
params:
{ "start": ["", "", ""], "limit": 10, "order": "by_cashout_time" }
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_cashout_time_no_date"
directory: "database_api_negative/list_comments"
error_response: true
......@@ -11,7 +11,8 @@
"hostname": "",
"level": "warn",
"line": 48,
"method": "from_iso_string"
"method": "from_iso_string",
"timestamp": "2020-09-10T17:10:39"
},
"data": {
"what": "basic_string::at: __n (which is 0) >= this->size() (which is 0)"
......
{
"code": -32000,
"data": {
"code": 13,
"message": "Day of month value is out of range 1..31",
"name": "N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian16bad_day_of_monthEEEEE",
"stack": [
{
"context": {
"file": "time.cpp",
"hostname": "",
"level": "warn",
"line": 48,
"method": "from_iso_string",
"timestamp": "2020-09-10T17:10:39"
},
"data": {
"what": "Day of month value is out of range 1..31"
},
"format": "${what}: unable to convert ISO-formatted string to fc::time_point_sec"
}
]
},
"message": "Day of month value is out of range 1..31:Day of month value is out of range 1..31: unable to convert ISO-formatted string to fc::time_point_sec"
}
{
"code": -32602,
"data": "Date is blank",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments test order "by_last_update" no date
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments no date
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.list_comments"
params:
{ "start": ["", "", "", ""], "limit": 10, "order": "by_last_update" }
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_last_update_no_date"
directory: "database_api_negative/list_comments"
error_response: true
{
"code": -32000,
"data": {
"code": 13,
"message": "Day of month value is out of range 1..31",
"name": "N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian16bad_day_of_monthEEEEE",
"stack": [
{
"context": {
"file": "time.cpp",
"hostname": "",
"level": "warn",
"line": 48,
"method": "from_iso_string",
"timestamp": "2020-09-10T17:10:39"
},
"data": {
"what": "Day of month value is out of range 1..31"
},
"format": "${what}: unable to convert ISO-formatted string to fc::time_point_sec"
}
]
},
"message": "Day of month value is out of range 1..31:Day of month value is out of range 1..31: unable to convert ISO-formatted string to fc::time_point_sec"
}
{
"code": -32602,
"data": "invalid account name length: `2016-08-24T21:29:42`",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments "by_last_update" wrong author
marks:
- patterntest # first arg is author, not date (error about date)
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments wrong author
request: