You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asynctest is currently used to test the NeoNode and the convenience manager classes in the network package of mamba. While it still works, people are reporting issues with Python 3.8 and 3.9 on the asynctest repo. It has not had an update in 2 years and the author indicated he is not maintaining it.
From Python3.8 upwards std's unittest has a new test class IsolatedAsyncioTestCase and AsyncMock that should make it possible to drop asyntest. The main thing to figure out is probably how/what to replace asynctest.SocketMock with.
The text was updated successfully, but these errors were encountered:
I actually made an attempt to use python-mocket but it's main focus seems to be more to support http like requests. It patches socket.socket but apparently not in a way that it can be re-used as argument to NeoNode.connect_to(socket=<arg>)
This throws: A Stream Socket was expected, got <class \'mocket.mocket.MocketSocket\'>
with Mocketizer():
sock = socket.socket
sock._address = (host, port) # fix socket.getbyhostname()
n, reason = await node.NeoNode.connect_to(socket=sock)
This fails in mockets true_sendall()
with Mocketizer():
sock = mocket.MocketSocket()
sock._address = (host, port) # fix socket.getbyhostname()
n, reason = await node.NeoNode.connect_to(socket=sock)
the error
Traceback (most recent call last):
File "/home/erik/neo-mamba/venv39/lib/python3.9/site-packages/mocket/mocket.py", line 340, in true_sendall
encoded_response = hexload(response_dict["response"])
KeyError: 'response'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 918, in write
n = self._sock.send(data)
File "/home/erik/neo-mamba/venv39/lib/python3.9/site-packages/mocket/mocket.py", line 392, in send
self.sendall(data, entry=entry, *args, **kwargs)
File "/home/erik/neo-mamba/venv39/lib/python3.9/site-packages/mocket/mocket.py", line 270, in sendall
response = self.true_sendall(data, *args, **kwargs)
File "/home/erik/neo-mamba/venv39/lib/python3.9/site-packages/mocket/mocket.py", line 343, in true_sendall
host, port = Mocket._address
AttributeError: type object 'Mocket' has no attribute '_address'
asynctest is currently used to test the
NeoNode
and the convenience manager classes in thenetwork
package of mamba. While it still works, people are reporting issues with Python 3.8 and 3.9 on theasynctest
repo. It has not had an update in 2 years and the author indicated he is not maintaining it.From Python3.8 upwards std's
unittest
has a new test class IsolatedAsyncioTestCase and AsyncMock that should make it possible to dropasyntest
. The main thing to figure out is probably how/what to replaceasynctest.SocketMock
with.The text was updated successfully, but these errors were encountered: