The remaining_budget() method calculates how much of the budget is left after accounting for expenses. If an invalid or negative expense is added, or if categories are misused, this function could return misleading values.
- Correct calculation with known expenses.
- Unexpected categories: when a user adds a category not predefined (e.g., "shopping"), it should go into "other".
- Negative values: if a user adds a negative amount by mistake, it can artificially inflate the remaining budget.
These tests help ensure that budgeting calculations remain logical even in edge cases, like unexpected input or human error. A future improvement might be to prevent negative expenses altogether or warn the user.
Different test for the function in trip.py, to make sure they work as intended.