Implement a functionality that allows for the management of a simple contact list application. The application should allow users to add, retrieve, update, and delete contacts. Each contact should have the following attributes: id, name, email, and phone_number.
Requirements:
Create a Contact class in the /app/ directory with the following properties:
id: a unique identifier for each contact (integer)
name: the name of the contact (string)
email: the email address of the contact (string)
phone_number: the phone number of the contact (string)
Create a ContactList class in the /app/ directory with the following methods:
add_contact(contact: Contact): Adds a new contact to the contact list. Ensure that the id is unique.
get_contact(contact_id: int) -> Contact: Retrieves a contact by its id. If the contact does not exist, return None.
update_contact(contact_id: int, updated_contact: Contact): Updates an existing contact's information using the provided updated_contact. If the contact_id does not exist, raise a ValueError.
delete_contact(contact_id: int): Deletes a contact by its id. If the contact_id does not exist, raise a ValueError.
Implement appropriate error handling to raise exceptions when trying to update or delete a non-existing contact.
Provide unit tests in a separate test file that verifies:
Successful addition, retrieval, updating, and deletion of contacts.
Proper error handling when trying to retrieve, update, or delete non-existing contacts.
Following these requirements will ensure that the tests provided will pass successfully.