Staging instance, all changes can be removed at any time

Skip to content

test: Deal with divergent test output depending on magic version

This fixes the indexer debian package build.

=================================== FAILURES ===================================
________________________ test_compute_mimetype_encoding ________________________

def test_compute_mimetype_encoding():
    """Compute mimetype encoding should return results"""
        for _input, _mimetype, _encoding in [
                ("du français".encode(), "text/plain", "utf-8"),
                (b"def __init__(self):", "text/x-python", "us-ascii"),
                (b"\xff\xfe\x00\x00\x00\x00\xff\xfe\xff\xff", "application/octet-stream", ""),
        ]:
            actual_result = compute_mimetype_encoding(_input)
            >           assert actual_result == {"mimetype": _mimetype, "encoding": _encoding}
            E           AssertionError: assert {'encoding': ...cript.python'} == {'encoding': '...ext/x-python'}
            E             Omitting 1 identical items, use -vv to show
            E             Differing items:
            E             {'mimetype': 'text/x-script.python'} != {'mimetype': 'text/x-python'}
            E             Use -v to get the full diff

swh/indexer/tests/test_mimetype.py:36: AssertionError

Test Plan

tox


Migrated from D4619 (view on Phabricator)

Merge request reports

Loading