Implement a User class in the /app/ directory that meets the following specifications:
Functionality Requirements:
The User class should have the following attributes:
username: A string that represents the user's username (should be unique).
email: A string representing the user's email address (should be unique and in proper email format).
age: An integer representing the user's age (should be a positive number).
The User class should include the following methods:
__init__(self, username: str, email: str, age: int): A constructor that initializes a user's username, email, and age. It should raise a ValueError if:
The username is empty or already exists.
The email is not in a valid format or already exists.
The age is not a positive integer.
__str__(self): A method that returns a string representation of the user in the format: "Username: {username}, Email: {email}, Age: {age}".
Implement a class-level method:
get_usernames(cls): This method should return a list of all usernames that have been created through the User class.
Additional Implementation Requirements:
The class must maintain a record of all created user instances to enforce the uniqueness of the username and email fields.
Provide appropriate unit tests to verify that:
Users can be created successfully with valid attributes.
Users cannot be created with duplicate usernames or emails.
Users cannot be created with invalid age or email formats.
The string representation of the user is correct.
The get_usernames method returns the correct list of usernames.
Make sure to organize your implementation logically, and follow best practices for code structure and error handling.