live_server = <[AttributeError("'LiveServer' object has no attribute 'url'") raised in repr()] LiveServer object at 0x7fcee6a6ada0>
aiosession = <async_generator object aiosession at 0x7fcefc232048>
big_source_tree = Directory(id=731eb28823efc1107f1595d2cdef1513883824dd, entries=[b'dir'])
@pytest.mark.asyncio
async def test_greedy_bfs_get_nodes_chunks(live_server, aiosession, big_source_tree):
api_url = url_for("index", _external=True)
nodes_data = MerkleNodeInfo()
init_merkle_node_info(big_source_tree, nodes_data, {"known"})
policy = GreedyBFS(big_source_tree, nodes_data)
client = Client(api_url, aiosession)
chunks = [
n_chunk
async for n_chunk in policy.get_nodes_chunks(
> client, source_size(big_source_tree)
)
]
.tox/py3/lib/python3.7/site-packages/swh/scanner/tests/test_policy.py:144:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/scanner/tests/test_policy.py:142: in <listcomp>
n_chunk
.tox/py3/lib/python3.7/site-packages/swh/scanner/policy.py:99: in get_nodes_chunks
swhids_res = await client.known(swhids)
.tox/py3/lib/python3.7/site-packages/swh/scanner/client.py:96: in known
return await make_request(swhids)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
swhids = ['swh:1:dir:731eb28823efc1107f1595d2cdef1513883824dd', 'swh:1:dir:6623effb609864b06dfa6ddf0404de9587947a58', 'swh:1:di...6ade', 'swh:1:dir:82af544993b9ac8e2726aa87332574792ca80850', 'swh:1:dir:aa3f5dcbf74e83f2ac3a907265065d4e08c74ebb', ...]
async def make_request(swhids):
swhids = [str(swhid) for swhid in swhids]
> async with self.session.post(endpoint, json=swhids) as resp:
E AttributeError: 'async_generator' object has no attribute 'post'
.tox/py3/lib/python3.7/site-packages/swh/scanner/client.py:82: AttributeError
TEST RESULT
TEST RESULT
- Run At
- May 9 2022, 12:44 PM