self = <swh.indexer.tests.test_mimetype.TestMimetypePartitionIndexer testMethod=test__index_contents>
def test__index_contents(self):
"""Indexing contents without existing data results in indexed data
"""
partition_id = 0
nb_partitions = 4
actual_results = list(
self.indexer._index_contents(partition_id, nb_partitions, indexed={})
)
> self.assert_results_ok(partition_id, nb_partitions, actual_results)
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/utils.py:726:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.indexer.tests.test_mimetype.TestMimetypePartitionIndexer testMethod=test__index_contents>
partition_id = 0, nb_partitions = 4
actual_results = [{'encoding': 'us-ascii', 'id': b'h\x8a^\xf8\x12\xc59\x07V/\xe3y\xd4\xb3\x85\x1ei\xc7\xcb\x15', 'indexer_configuration_id': 5092734900620598343, 'mimetype': 'text/plain'}]
def assert_results_ok(self, partition_id, nb_partitions, actual_results):
expected_ids = [
c.sha1
for c in stream_results(
self.indexer.storage.content_get_partition,
partition_id=partition_id,
nb_partitions=nb_partitions,
)
]
start, end = get_partition_bounds_bytes(partition_id, nb_partitions, SHA1_SIZE)
actual_results = list(actual_results)
for indexed_data in actual_results:
_id = indexed_data["id"]
assert isinstance(_id, bytes)
assert _id in expected_ids
assert start <= _id
if end:
> assert _id <= end
E AssertionError: assert b'h\x8a^\xf8\x12\xc59\x07V/\xe3y\xd4\xb3\x85\x1ei\xc7\xcb\x15' <= b'@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/utils.py:710: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Aug 20 2020, 12:18 PM