self = <RemoteGraphClient url=http://127.0.0.1:56981/graph/>
response = <Response [400]>
def raise_for_status(self, response) -> None:
"""check response HTTP status code and raise an exception if it denotes an
error; do nothing otherwise
"""
status_code = response.status_code
status_class = response.status_code // 100
if status_code == 404:
raise RemoteException(payload="404 not found", response=response)
exception = None
# TODO: only old servers send pickled error; stop trying to unpickle
# after they are all upgraded
try:
if status_class == 4:
data = self._decode_response(response, check_status=False)
if isinstance(data, dict):
for exc_type in self.reraise_exceptions:
if exc_type.__name__ == data["exception"]["type"]:
exception = exc_type(*data["exception"]["args"])
break
else:
exception = RemoteException(
payload=data["exception"], response=response
)
else:
> exception = pickle.loads(data)
E TypeError: a bytes-like object is required, not 'str'
.tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:326: TypeError
During handling of the above exception, another exception occurred:
graph_client = <RemoteGraphClient url=http://127.0.0.1:56981/graph/>
def test_random_walk(graph_client):
"""as the walk is random, we test a visit from a cnt node to the only origin in
the dataset, and only check the final node of the path (i.e., the origin)
"""
args = ("swh:1:cnt:0000000000000000000000000000000000000001", "ori")
kwargs = {"direction": "backward"}
expected_root = "swh:1:ori:0000000000000000000000000000000000000021"
> actual = list(graph_client.random_walk(*args, **kwargs))
.tox/py3/lib/python3.7/site-packages/swh/graph/tests/test_api_client.py:223:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/graph/client.py:31: in get_lines
yield from self.raw_verb_lines("get", endpoint, **kwargs)
.tox/py3/lib/python3.7/site-packages/swh/graph/client.py:26: in raw_verb_lines
self.raise_for_status(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <RemoteGraphClient url=http://127.0.0.1:56981/graph/>
response = <Response [400]>
def raise_for_status(self, response) -> None:
"""check response HTTP status code and raise an exception if it denotes an
error; do nothing otherwise
"""
status_code = response.status_code
status_class = response.status_code // 100
if status_code == 404:
raise RemoteException(payload="404 not found", response=response)
exception = None
# TODO: only old servers send pickled error; stop trying to unpickle
# after they are all upgraded
try:
if status_class == 4:
data = self._decode_response(response, check_status=False)
if isinstance(data, dict):
for exc_type in self.reraise_exceptions:
if exc_type.__name__ == data["exception"]["type"]:
exception = exc_type(*data["exception"]["args"])
break
else:
exception = RemoteException(
payload=data["exception"], response=response
)
else:
exception = pickle.loads(data)
elif status_class == 5:
data = self._decode_response(response, check_status=False)
if "exception_pickled" in data:
exception = pickle.loads(data["exception_pickled"])
else:
exception = RemoteException(
payload=data["exception"], response=response
)
except (TypeError, pickle.UnpicklingError):
> raise RemoteException(payload=data, response=response)
E swh.core.api.RemoteException: invalid edge restriction: %2A
.tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:338: RemoteException
TEST RESULT
TEST RESULT
- Run At
- Oct 5 2020, 5:51 PM