The test_tag function is designed to verify whether a given string can be considered a valid tag by ensuring it does not contain any characters that are deemed illegal as defined in the ILLEGAL_TAG_CHARS variable.
What the function should do:
Take a single input parameter, tag, which is a string.
Return False if:
The input string is empty.
Any character in the tag matches a character in the predefined ILLEGAL_TAG_CHARS.
Return True if:
The tag is not empty and does not contain any illegal characters.
Expected input/output behavior:
Input: A string tag.
Output: A boolean value - True if the tag is valid, False otherwise.
Edge cases to handle:
An empty string should return False.
A string that contains only illegal characters should return False.
A string that contains valid characters only (none from ILLEGAL_TAG_CHARS) should return True.
Strings that contain a mix should return False even if valid characters are present.
Note: The solution must be placed in /app/solution.py. The function should be importable as from solution import test_tag.