MCPcopy Create free account
hub / github.com/cdgriffith/Box / check_comments

Function check_comments

test/test_audit_sync.py:42–56  ·  view source on GitHub ↗

A comment, wherever it is, must be the one of the item now at that position, and every item id in `kept` must still have its comment.

(bl, kept)

Source from the content-addressed store, hash-verified

40
41
42def check_comments(bl, kept):
43 """
44 A comment, wherever it is, must be the one of the item now at that position, and every
45 item id in `kept` must still have its comment.
46 """
47 seen = set()
48 for i, item in enumerate(bl):
49 comment = bl.get_comment(i)
50 if comment is None:
51 continue
52 assert isinstance(item, Box), f"comment {comment} on non item {item!r} at {i}"
53 assert comment == {"eol": f"c{item.id}"}, f"position {i} holds item {item.id} but has comment {comment}"
54 seen.add(item.id)
55 missing = set(kept) - seen
56 assert not missing, f"comments lost for items {sorted(missing)}"
57
58
59def check_converted(bl, **options):

Calls 1

get_commentMethod · 0.45

Tested by

no test coverage detected