Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_journal_client.py
Show All 30 Lines | def testOneOriginVisit(self): | ||||
[ | [ | ||||
{ | { | ||||
"arguments": { | "arguments": { | ||||
"kwargs": {"policy_update": "update-dups"}, | "kwargs": {"policy_update": "update-dups"}, | ||||
"args": (["file:///dev/zero"],), | "args": (["file:///dev/zero"],), | ||||
}, | }, | ||||
"policy": "oneshot", | "policy": "oneshot", | ||||
"type": "task-name", | "type": "task-name", | ||||
"retries_left": 1, | |||||
}, | }, | ||||
], | ], | ||||
), | ), | ||||
) | ) | ||||
def testOriginVisitLegacy(self): | def testOriginVisitLegacy(self): | ||||
mock_scheduler = Mock() | mock_scheduler = Mock() | ||||
messages = { | messages = { | ||||
Show All 17 Lines | def testOriginVisitLegacy(self): | ||||
[ | [ | ||||
{ | { | ||||
"arguments": { | "arguments": { | ||||
"kwargs": {"policy_update": "update-dups"}, | "kwargs": {"policy_update": "update-dups"}, | ||||
"args": (["file:///dev/zero"],), | "args": (["file:///dev/zero"],), | ||||
}, | }, | ||||
"policy": "oneshot", | "policy": "oneshot", | ||||
"type": "task-name", | "type": "task-name", | ||||
"retries_left": 1, | |||||
}, | }, | ||||
], | ], | ||||
), | ), | ||||
) | ) | ||||
def testOneOriginVisitBatch(self): | def testOneOriginVisitBatch(self): | ||||
mock_scheduler = Mock() | mock_scheduler = Mock() | ||||
messages = { | messages = { | ||||
Show All 18 Lines | def testOneOriginVisitBatch(self): | ||||
[ | [ | ||||
{ | { | ||||
"arguments": { | "arguments": { | ||||
"kwargs": {"policy_update": "update-dups"}, | "kwargs": {"policy_update": "update-dups"}, | ||||
"args": (["file:///dev/zero", "file:///tmp/foobar"],), | "args": (["file:///dev/zero", "file:///tmp/foobar"],), | ||||
}, | }, | ||||
"policy": "oneshot", | "policy": "oneshot", | ||||
"type": "task-name", | "type": "task-name", | ||||
"retries_left": 1, | |||||
}, | }, | ||||
], | ], | ||||
), | ), | ||||
) | ) | ||||
@patch("swh.indexer.journal_client.MAX_ORIGINS_PER_TASK", 2) | @patch("swh.indexer.journal_client.MAX_ORIGINS_PER_TASK", 2) | ||||
def testOriginVisitBatches(self): | def testOriginVisitBatches(self): | ||||
mock_scheduler = Mock() | mock_scheduler = Mock() | ||||
Show All 21 Lines | def testOriginVisitBatches(self): | ||||
[ | [ | ||||
{ | { | ||||
"arguments": { | "arguments": { | ||||
"kwargs": {"policy_update": "update-dups"}, | "kwargs": {"policy_update": "update-dups"}, | ||||
"args": (["file:///dev/zero", "file:///tmp/foobar"],), | "args": (["file:///dev/zero", "file:///tmp/foobar"],), | ||||
}, | }, | ||||
"policy": "oneshot", | "policy": "oneshot", | ||||
"type": "task-name", | "type": "task-name", | ||||
"retries_left": 1, | |||||
}, | }, | ||||
{ | { | ||||
"arguments": { | "arguments": { | ||||
"kwargs": {"policy_update": "update-dups"}, | "kwargs": {"policy_update": "update-dups"}, | ||||
"args": (["file:///tmp/spamegg"],), | "args": (["file:///tmp/spamegg"],), | ||||
}, | }, | ||||
"policy": "oneshot", | "policy": "oneshot", | ||||
"type": "task-name", | "type": "task-name", | ||||
"retries_left": 1, | |||||
}, | }, | ||||
], | ], | ||||
), | ), | ||||
) | ) |