'Check the QT_HARFBUZZ env var.'

@pytest.mark.parametrize('harfbuzz,    qt_version,    platform,    expected', [('auto', '5.2.1', 'linux', 'old'), ('auto', '5.3.0', 'linux', 'new'), ('auto', '5.3.2', 'linux', 'old'), ('auto', '5.4.0', 'linux', None), ('auto', '5.2.1', 'windows', None), ('old', '5.3.0', 'linux', 'old'), ('old', '5.4.0', 'linux', 'old'), ('new', '5.2.1', 'linux', 'new'), ('new', '5.3.2', 'linux', 'new'), ('new', '5.4.0', 'linux', 'new')])
def test_fix_harfbuzz(self, clear_harfbuzz, args, monkeypatch, caplog, harfbuzz, qt_version, platform, expected):

    args.harfbuzz = harfbuzz
    monkeypatch.setattr(earlyinit, '_qt_version', (lambda : pkg_resources.parse_version(qt_version)))
    monkeypatch.setattr(earlyinit.sys, 'platform', platform)
    with caplog.at_level(logging.WARNING):
        earlyinit.fix_harfbuzz(args)
    assert (os.environ.get('QT_HARFBUZZ', None) == expected)
