From d8c43a436f80100cd81db3923a968c0c24382ec6 Mon Sep 17 00:00:00 2001 From: Howo Date: Sun, 7 Dec 2025 14:42:20 -0500 Subject: [PATCH 1/2] Ignore timestamps in errors --- validate_response/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/validate_response/__init__.py b/validate_response/__init__.py index 7191c92a..fbd0d40f 100644 --- a/validate_response/__init__.py +++ b/validate_response/__init__.py @@ -36,6 +36,7 @@ predefined_ignore_tags: dict[str, re.Pattern] = { '' : re.compile(r"root\['post_id'\]"), # tags_api.get_discussion '' : re.compile(r"root\['votes_updated_at'\]"), # witness api in haf_block_explorer '' : re.compile(r"root\[\d+\]\['id'\]"), + '': re.compile(r"root\['data'\]\['stack'\]\[\d+\]\['context'\]\['timestamp'\]"), # ignore timestamps in errors } def get_overlap(s1, s2): -- GitLab From dabe01b917ff52f5a3ab76bd5521e2fc8252fe4d Mon Sep 17 00:00:00 2001 From: Howo Date: Sun, 7 Dec 2025 16:07:58 -0500 Subject: [PATCH 2/2] Fix typos in comments and documentation Fixed multiple spelling errors across the codebase: - separatly -> separately - setupt.py -> setup.py - dobuble -> double - coparison/comparision/comparition -> comparison - nonblicking -> nonblocking - spefified -> specified - unworking argument are -> non-working arguments are - Expeced -> Expected - avaiable -> available --- README.md | 8 ++++---- benchmarks/README.md | 2 +- hivemind/reference/follow_api/readme.md | 14 +++++++------- hivemind/reference/tags_api/README.md | 8 ++++---- .../tags_api/get_post_discussions_by_payout.py | 2 +- jsonsocket.py | 4 ++-- testbase.py | 2 +- validate_response/__init__.py | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a368d331..89327a8b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -**Abstract**: This repository contains tests for API. All API tests are currently - grouped for these served by hived and these served by hivemind. The goal is to - have flat list of the tests and start their subsets separatly by hived and +**Abstract**: This repository contains tests for API. All API tests are currently + grouped for these served by hived and these served by hivemind. The goal is to + have flat list of the tests and start their subsets separately by hived and hivemind CI processes. # Usage: @@ -12,7 +12,7 @@ ``` git clone https://github.com/svanoort/pyresttest.git cd pyresttest -python3 setupt.py build +python3 setup.py build python3 setup.py install --user ``` diff --git a/benchmarks/README.md b/benchmarks/README.md index 7bfee47e..3fae2b75 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -27,7 +27,7 @@ To list available csv inputs, use `-l` flag + `-n` with api name (by default `ac # output ... -2022-08-04 15:34:26,279 - performance - INFO - Found and avaiable csv's: +2022-08-04 15:34:26,279 - performance - INFO - Found and available csv's: perf_5M_light.csv cl_60M_prod_jrpc.csv diff --git a/hivemind/reference/follow_api/readme.md b/hivemind/reference/follow_api/readme.md index 4daf8f4c..fe1df5df 100644 --- a/hivemind/reference/follow_api/readme.md +++ b/hivemind/reference/follow_api/readme.md @@ -3,12 +3,12 @@ ## get_account_reputations `python3 get_account_reputations.py https://api.steem.house https://api.steemit.com ./ 1 blocktrades 1` -Expeced result: same result on both nodes +Expected result: same result on both nodes ## get_blog `python3 get_blog.py https://api.steem.house https://api.steemit.com ./ 1 blocktardes 0 1` -**Expeced result: Differences found at post_id and json_metadata** +**Expected result: Differences found at post_id and json_metadata** ## get_blog_authors @@ -17,7 +17,7 @@ Calling method follow_api.get_blog_authors returns error - {"code":-32601,"messa ## get_blog_entries `python3 get_blog_entries.py https://api.steem.house https://api.steemit.com ./ 1 blocktrades 0 1` -Expeced result: same result on both nodes +Expected result: same result on both nodes ## get_feed @@ -30,20 +30,20 @@ Calling method follow_api.get_feed_entries returns error - {"code":-32601,"messa ## get_follow_count `python3 get_follow_count.py https://api.steem.house https://api.steemit.com ./ 1 blocktrades` -**Expeced result: Differences found at follower_count** +**Expected result: Differences found at follower_count** ## get_followers `python3 get_followers.py https://api.steem.house https://api.steemit.com ./ 1 steemit '' blog 10` -Expeced result: same result on both nodes +Expected result: same result on both nodes ## get_following `python3 get_following.py https://api.steem.house https://api.steemit.com ./ 1 blocktrades '' blog 10` -Expeced result: same result on both nodes +Expected result: same result on both nodes ## get_reblogged_by `python3 get_reblogged_by.py https://api.steem.house https://api.steemit.com ./ 1 steemit firstpost` -Expeced result: same result on both nodes +Expected result: same result on both nodes diff --git a/hivemind/reference/tags_api/README.md b/hivemind/reference/tags_api/README.md index 149313d4..97446208 100644 --- a/hivemind/reference/tags_api/README.md +++ b/hivemind/reference/tags_api/README.md @@ -123,7 +123,7 @@ Method not found. ##### Returns a list of discussions by comments. `python3 get_discussions_by_comments.py https://api.steemit.com https://api.steem.house ./ steemmeupscotty black-dog-on-a-hong-kong-sunrise-animal-landscape-photography 1` -Method works fine, we have comparision error in `active_votes` `json_metadata` and `post_id`. +Method works fine, we have comparison error in `active_votes` `json_metadata` and `post_id`. Documentation isn't correct, instead `tag` argument there are `start_author` and `start_permlink`. @@ -131,7 +131,7 @@ Documentation isn't correct, instead `tag` argument there are `start_author` and ##### Returns a list of discussions by created. `python3 get_discussions_by_created.py https://api.steemit.com https://api.steem.house ./ blocktrades 1` -Method works fine, comparision error in `post_id` only. +Method works fine, comparison error in `post_id` only. ####get_discussions_by_feed #####Returns a list of discussions by feed. @@ -143,7 +143,7 @@ Method not found. ##### Returns a list of discussions by hot. `python3 get_discussions_by_hot.py https://api.steemit.com https://api.steem.house ./ blocktrades 1` -Method works fine, comparision error in `post_id` only. +Method works fine, comparison error in `post_id` only. #### get_discussions_by_promoted ##### Returns a list of discussions by promoted. @@ -192,7 +192,7 @@ Method not found. ##### Returns a list of post discussions by payout. `python3 get_post_discussions_by_payout.py https://api.steemit.com https://api.steem.house ./ blocktrades 1` -Method works fine, but there is difference in comparition: +Method works fine, but there is difference in comparison: ``` Differences detected in jsons: { diff --git a/hivemind/reference/tags_api/get_post_discussions_by_payout.py b/hivemind/reference/tags_api/get_post_discussions_by_payout.py index b9ce1012..88e78b84 100644 --- a/hivemind/reference/tags_api/get_post_discussions_by_payout.py +++ b/hivemind/reference/tags_api/get_post_discussions_by_payout.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Currently unworking argument are commented. +# Currently non-working arguments are commented. import os import sys diff --git a/jsonsocket.py b/jsonsocket.py index df003d9e..91079c64 100644 --- a/jsonsocket.py +++ b/jsonsocket.py @@ -6,12 +6,12 @@ import socket class JSONSocket(object): """ Class encapsulates socket object with special handling json rpc. - timeout is ignored now - nonblicking socket not supported. + timeout is ignored now - nonblocking socket not supported. """ def __init__(self, host, port, path, timeout=None): """ host in form [http[s]://][:port] - if port not in host must be spefified as argument + if port not in host must be specified as argument """ self.__sock = None if host.find("http://") == 0 or host.find("https://") == 0: diff --git a/testbase.py b/testbase.py index 32212f2a..c2fdc8b5 100755 --- a/testbase.py +++ b/testbase.py @@ -128,7 +128,7 @@ class SimpleJsonTest(object): if json_diff: print("Differences detected in jsons: {}".format(self.json_pretty_string(json_diff))) - # avoid dobuble write in case of error detected and differences detected. + # avoid double write in case of error detected and differences detected. if json1_error is None: self.write_to_file(filename1, json1, self._test_node) if json2_error is None: diff --git a/validate_response/__init__.py b/validate_response/__init__.py index fbd0d40f..60a4d6e4 100644 --- a/validate_response/__init__.py +++ b/validate_response/__init__.py @@ -201,7 +201,7 @@ def has_valid_response(response, method=None, directory=None, error_response=Fal else: correct_response = result - # disable coparison with pattern on demand + # disable comparison with pattern on demand # and save if tavern_disable_comparator: test_id = response_json.get("id", None) -- GitLab