The validate_value function is designed to validate a given string value against a specific regular expression pattern, which is fetched by calling the _get_labels_regex() function. If the provided value does not conform to the expected pattern, the function raises a ValidationError.
Task Description:
Implement the validate_value function, which:
Accepts a string input, value.
Validates this input against a regular expression returned by the _get_labels_regex() function.
If the input does not match the regular expression, it raises a ValidationError with a message indicating the invalid input and the expected regex pattern.
Expected Input/Output Behavior:
Input: A string value that needs to be validated.
Output:
If the value matches the regular expression, the function completes without any errors.
If the value does not match, a ValidationError is raised.
Edge Cases to Handle:
Input strings that contain special characters or are of unexpected length.
An empty string or None as input.
Input values that exactly match the boundaries defined by the regex.
Ensure that various types for the input (String, int) are handled properly, focusing on string inputs primarily.
Note: The solution should be placed in /app/solution.py. The function must be importable as: