Remote node can not be easily connected to URLs without explicitly given port
Such use case should work:
import test_tools as tt
node = tt.RemoteNode("api.hive.blog")
node.api.database.list_witnesses(start=None, limit=100, order='by_name')
but it causes following error:
Traceback (most recent call last):
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/requests/models.py", line 384, in prepare_url
scheme, auth, host, port, path, query, fragment = parse_url(url)
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/urllib3/util/url.py", line 397, in parse_url
return six.raise_from(LocationParseError(source_url), None)
File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: http://api.hive.blog:None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "/home/dev/workspace/hive/tests/test_tools/package/test_tools/node_api/api_base.py", line 17, in __call__
response = self.__node.send(
File "/home/dev/workspace/hive/tests/test_tools/package/test_tools/__private/remote_node.py", line 31, in send
response = communication.request(
File "/home/dev/workspace/hive/tests/test_tools/package/test_tools/__private/communication.py", line 43, in __implementation
return send_request(*args, **kwargs)
File "/home/dev/workspace/hive/tests/test_tools/package/test_tools/__private/communication.py", line 69, in request
response = requests.post(url, data=message)
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/requests/api.py", line 117, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/requests/sessions.py", line 515, in request
prep = self.prepare_request(req)
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/requests/sessions.py", line 443, in prepare_request
p.prepare(
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/requests/models.py", line 318, in prepare
self.prepare_url(url, params)
File "/home/dev/workspace/hive/tests/venv/lib/python3.8/site-packages/requests/models.py", line 386, in prepare_url
raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://api.hive.blog:None
Problem is of course because of included None
to given URL: http://api.hive.blog:None
.