swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7fc3858da278>
def test_create_origin_task_dicts(swh_scheduler):
listers = []
for lister_args in LISTERS:
listers.append(swh_scheduler.get_or_create_lister(**lister_args))
origin1 = model.ListedOrigin(
lister_id=listers[0].id,
url="http://example.com/1",
visit_type="git",
)
origin2 = model.ListedOrigin(
lister_id=listers[0].id,
url="http://example.com/2",
visit_type="git",
)
origin3 = model.ListedOrigin(
lister_id=listers[1].id,
url="http://example.com/3",
visit_type="git",
)
origins = [origin1, origin2, origin3]
tasks = utils.create_origin_task_dicts(origins, swh_scheduler)
> assert tasks == [
{
"type": "load-git",
"arguments": {
"args": [],
"kwargs": {
"url": "http://example.com/1",
"lister_name": LISTERS[0]["name"],
"lister_instance_name": None,
},
},
},
{
"type": "load-git",
"arguments": {
"args": [],
"kwargs": {
"url": "http://example.com/2",
"lister_name": LISTERS[0]["name"],
"lister_instance_name": None,
},
},
},
{
"type": "load-git",
"arguments": {
"args": [],
"kwargs": {
"url": "http://example.com/3",
"lister_name": LISTERS[1]["name"],
"lister_instance_name": LISTERS[1]["instance_name"],
},
},
},
]
E AssertionError: assert [{'arguments'...: 'load-git'}] == [{'arguments'...: 'load-git'}]
E At index 0 diff: {'type': 'load-git', 'arguments': {'args': [], 'kwargs': {'url': 'http://example.com/1', 'lister_name': 'github', 'lister_instance_name': 'github'}}} != {'type': 'load-git', 'arguments': {'args': [], 'kwargs': {'url': 'http://example.com/1', 'lister_name': 'github', 'lister_instance_name': None}}}
E Full diff:
E [
E {'arguments': {'args': [],
E - 'kwargs': {'lister_instance_name': None,
E ? ^^^^
E + 'kwargs': {'lister_instance_name': 'github',...
E
E ...Full output truncated (19 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_utils.py:157: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Dec 6 2022, 4:24 PM