Implement a Shopping Cart functionality that allows users to add, remove, and view items in their cart. The following specific requirements must be met for the implementation to pass the provided tests:
CartItem Class:
Create a CartItem class that represents an item in the shopping cart.
It should have the following properties:
name (string): The name of the item.
price (float): The price of the item.
quantity (int): The quantity of the item in the cart.
ShoppingCart Class:
Create a ShoppingCart class with the following functionalities:
Add Item: Implement a method add_item(cart_item: CartItem) that adds an item to the cart. If the item already exists, increase its quantity instead of adding a new entry.
Remove Item: Implement a method remove_item(item_name: str) that removes an item from the cart based on its name. If the item's quantity is greater than one, decrease the quantity instead of removing it completely.
Get Total: Implement a method get_total() -> float that returns the total price of all items in the cart (price * quantity for each item).
Get Items: Implement a method get_items() -> List[CartItem] that returns a list of all items currently in the cart.
Unit Tests:
Ensure that your implementation passes the existing unit tests that check the functionality of adding, removing, and calculating the total price of items in the cart.
All code for this functionality should be placed in the /app/ directory under appropriate file names, such as cart.py for the main logic and test_cart.py for unit tests.