def test_config_check_str_bad(): value = {"11111": "x"} with pytest.raises(ConfigInvalidValue): config_check_str(value=value, schema=SCHEMA_STR, source="badwolf") with pytest.raises(ConfigInvalidValue): config_check(value=value, schema=SCHEMA_STR, source="badwolf")
def test_config_check_str_enum_bad(): value = "xxxx" with pytest.raises(ConfigInvalidValue): config_check_str(value=value, schema=SCHEMA_STR_ENUM, source="badwolf") with pytest.raises(ConfigInvalidValue): config_check(value=value, schema=SCHEMA_STR_ENUM, source="badwolf")
def test_config_check_str(): value = "test" result = config_check_str(value=value, schema=SCHEMA_STR, source="badwolf") assert result == value result = config_check(value=value, schema=SCHEMA_STR, source="badwolf") assert result == value
def test_config_check_str_password_unchanged(value): result = config_check_str(value=value, schema=SCHEMA_STR_PASSWORD, source="badwolf") assert result == SETTING_UNCHANGED result = config_check(value=value, schema=SCHEMA_STR_PASSWORD, source="badwolf") assert result == SETTING_UNCHANGED
def test_config_check_str_password(): value = "badwolf" result = config_check_str(value=value, schema=SCHEMA_STR_PASSWORD, source="badwolf") assert result == value result = config_check(value=value, schema=SCHEMA_STR_PASSWORD, source="badwolf") assert result == value
def test_config_check_str_enum(): """Pass.""" value = "badwolf" result = config_check_str(value=value, schema=SCHEMA_STR_ENUM, source="badwolf") assert result == value result = config_check(value=value, schema=SCHEMA_STR_ENUM, source="badwolf") assert result == value