Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/tests/test_loader.py
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | def test_load(self): | ||||
# extract original changesets info and the transplant sources | # extract original changesets info and the transplant sources | ||||
hg_changesets = set() | hg_changesets = set() | ||||
transplant_sources = set() | transplant_sources = set() | ||||
for rev in self.storage.revision_log(revisions): | for rev in self.storage.revision_log(revisions): | ||||
hg_changesets.add(rev['metadata']['node']) | hg_changesets.add(rev['metadata']['node']) | ||||
for k, v in rev['metadata']['extra_headers']: | for k, v in rev['metadata']['extra_headers']: | ||||
if k == 'transplant_source': | if k == 'transplant_source': | ||||
transplant_sources.add(v) | transplant_sources.add(v.decode('ascii')) | ||||
vlorentz: if you want to go the bytehex way, you only need `.decode('ascii')` | |||||
Done Inline ActionsAck anlambert: Ack | |||||
# check extracted data are valid | # check extracted data are valid | ||||
self.assertTrue(len(hg_changesets) > 0) | self.assertTrue(len(hg_changesets) > 0) | ||||
self.assertTrue(len(transplant_sources) > 0) | self.assertTrue(len(transplant_sources) > 0) | ||||
self.assertTrue(transplant_sources.issubset(hg_changesets)) | self.assertTrue(transplant_sources.issubset(hg_changesets)) | ||||
def test_clone_with_timeout_timeout(caplog, tmp_path, monkeypatch): | def test_clone_with_timeout_timeout(caplog, tmp_path, monkeypatch): | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |
if you want to go the bytehex way, you only need .decode('ascii')