def METHOD_NAME(config_stub, setting, value, exp_key, exp_val):
    config_stub.val.colors.webpage.darkmode.enabled = True
    config_stub.set_obj('colors.webpage.darkmode.' + setting, value)
    expected = [
        ('preferredColorScheme', '2'),
        ('forceDarkModeEnabled', 'true'),
    ]
    if exp_key != 'ImagePolicy':
        expected.append(('forceDarkModeImagePolicy', '2'))
    expected.append(('forceDarkMode' + exp_key, exp_val))
    versions = version.WebEngineVersions.from_pyqt('5.15.2')
    darkmode_settings = darkmode.settings(versions=versions, special_flags=[])
    assert darkmode_settings['blink-settings'] == expected