Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Conversation

@codebeaver-ai
Copy link
Contributor

@codebeaver-ai codebeaver-ai bot commented Feb 3, 2025

CodeBeaver PR Summary

I started working from Add python Utils class: Investment and Expenses trackers

🔄 4 tests added and 4 tests updated to reflect recent changes.
🐛 Found 1 bug
🛠️ 15/15 tests passed

🔄 Test Updates

I've added or updated 6 tests. They all pass ☑️
Updated Tests:

  • tests/test_expense_tracker.py 🩹

    Fixed: tests/test_expense_tracker.py::TestExpenseTracker::test_categories_is_set_with_default_categories

  • tests/test_expense_tracker.py 🩹

    Fixed: tests/test_expense_tracker.py::TestExpenseTracker::test_remove_category

  • tests/test_investment_tracker.py 🩹

    Fixed: tests/test_investment_tracker.py::TestInvestmentTracker::test_record_transaction

  • tests/test_investment_tracker.py 🩹

    Fixed: tests/test_investment_tracker.py::TestInvestmentTracker::test_register_new_category_empty_string

New Tests:

  • tests/test_alert_manager.py
  • tests/test_investment_tracker.py

🐛 Bug Detection

Potential issues found in the following files:

  • expense_tracker.py

The error occurs because the code in total_expense_by_category only converts the input parameter (category) to lower-case and compares it with the expense entries exactly. However, the expenses added in the test have "category" values in different cases (e.g., "FOOD", "Food") that are not converted to lower-case, so they don't match "food" (the lowercased input). This makes the method only sum the expense that exactly matches "food" in lower-case, resulting in an incorrect sum.

🛠️ Test Results

All 15 tests passed.

☂️ Coverage Improvements

Coverage improvements by file:

  • tests/test_expense_tracker.py

    New coverage: 61.54%
    Improvement: +61.54%

  • tests/test_investment_tracker.py

    New coverage: 57.14%
    Improvement: +57.14%

  • tests/test_alert_manager.py

    New coverage: 100.00%
    Improvement: +100.00%

  • tests/test_investment_tracker.py

    New coverage: 73.81%
    Improvement: +16.67%


Settings | Logs | CodeBeaver

@erlapso erlapso changed the title python-demo - Unit Tests Pytest - Complete demo - Unit Tests Feb 4, 2025
@erlapso erlapso added the tests label Feb 4, 2025
@erlapso erlapso changed the title Pytest - Complete demo - Unit Tests Unittest - Complete demo - Unit Tests Feb 5, 2025
@erlapso erlapso changed the title Unittest - Complete demo - Unit Tests Unittest - Complete demo Feb 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants