event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
live_server = <[AttributeError("'LiveServer' object has no attribute 'url'") raised in repr()] LiveServer object at 0x7fcee6a6ada0>
aiosession = <async_generator object aiosession at 0x7fcefc151950>
source_tree = Directory(id=0a7b61ef5780b03aa274d11069564980246445ce, entries=[b'some-binary', b'link-to-another-quote', b'foo', b'toexclude', b'bar', b'link-to-foo'])
nodes_data = {CoreSWHID.from_string('swh:1:dir:0a7b61ef5780b03aa274d11069564980246445ce'): {'known': None, 'origin': None}, CoreSWH...': None}, CoreSWHID.from_string('swh:1:cnt:19102815663d23f8b75a47e7a01965dcdc96468c'): {'known': None, 'origin': None}}
def test_add_origin(event_loop, live_server, aiosession, source_tree, nodes_data):
api_url = url_for("index", _external=True)
init_merkle_node_info(source_tree, nodes_data, {"known", "origin"})
client = Client(api_url, aiosession)
> event_loop.run_until_complete(add_origin(source_tree, nodes_data, client))
.tox/py3/lib/python3.7/site-packages/swh/scanner/tests/test_data.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/asyncio/base_events.py:584: in run_until_complete
return future.result()
.tox/py3/lib/python3.7/site-packages/swh/scanner/data.py:60: in add_origin
node_ori = await client.get_origin(node.swhid())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.scanner.client.Client object at 0x7fcefc220080>
swhid = CoreSWHID.from_string('swh:1:dir:0a7b61ef5780b03aa274d11069564980246445ce')
async def get_origin(self, swhid: CoreSWHID) -> Optional[Any]:
"""Walk the compressed graph to discover the origin of a given swhid"""
endpoint = (
f"{self.api_url}{GRAPH_RANDOMWALK_EP}{str(swhid)}/ori/?direction="
f"backward&limit=-1&resolve_origins=true"
)
res = None
> async with self.session.get(endpoint) as resp:
E AttributeError: 'async_generator' object has no attribute 'get'
.tox/py3/lib/python3.7/site-packages/swh/scanner/client.py:45: AttributeError
TEST RESULT
TEST RESULT
- Run At
- May 9 2022, 12:44 PM