Implement a simple user account management system that allows for the creation, retrieval, updating, and deletion of user accounts. The system should be designed to work with a in-memory data structure for storing user information.
Specific Requirements:
User Class:
Create a User class with the following attributes:
id (integer, unique identifier)
name (string)
email (string)
Ensure that the email attribute is unique across all instances of User.
UserManager Class:
Create a UserManager class that manages user accounts. This class should have the following methods:
create_user(name: str, email: str) -> User: Creates a new user with the given name and email. If the email already exists, raise a ValueError.
get_user(user_id: int) -> User: Returns the user object for the given user ID. If the user does not exist, return None.
update_user(user_id: int, name: str, email: str) -> User: Updates the name and email of the user with the specified user ID. Ensure that the email remains unique; if the new email already exists, raise a ValueError.
delete_user(user_id: int) -> bool: Deletes the user with the specified user ID. Return True if the user was deleted, or False if the user was not found.
Data Storage:
Use an in-memory list to store user instances in the UserManager class.
Testing:
Ensure that your implementation passes the provided test code. The tests will cover user creation, retrieval, updating, and deletion, including handling unique constraints for emails.
The solution should be implemented in /app/ with the following structure:
text
/app/
├── user.py # Contains User and UserManager classes