Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Conversation

@rohitvinnakota-codecov
Copy link
Contributor

This PR adds a class to process transactions.

@seer-by-sentry
Copy link
Contributor

Sentry has generated a new PR with unit tests for this PR. View the new PR(#938) to review the changes.

@seer-by-sentry seer-by-sentry bot mentioned this pull request Oct 29, 2024
@seer-by-sentry
Copy link
Contributor

Sentry has generated a new PR with unit tests for this PR. View the new PR(#939) to review the changes.

@seer-by-sentry seer-by-sentry bot mentioned this pull request Oct 29, 2024
@codecov
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.

Project coverage is 96.05%. Comparing base (142a003) to head (de74bf3).
Report is 43 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
billing/accounts.py 0.00% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #937      +/-   ##
==========================================
- Coverage   96.23%   96.05%   -0.18%     
==========================================
  Files         823      829       +6     
  Lines       18972    20424    +1452     
==========================================
+ Hits        18257    19619    +1362     
- Misses        715      805      +90     
Flag Coverage Δ
unit 92.58% <0.00%> (+0.11%) ⬆️
unit-latest-uploader 92.58% <0.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

Codecov Report

Attention: Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
billing/accounts.py 0.00% 26 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rohitvinnakota-codecov
Copy link
Contributor Author

@codecov-ai-reviewer hi

Comment on lines +22 to +27
def transfer(self, other_account, amount):
if not isinstance(other_account, BankAccount):
raise ValueError("Recipient must be a BankAccount instance")
self.withdraw(amount)
other_account.deposit(amount)
return self.balance, other_account.balance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transfer method should handle the case where the transfer fails due to insufficient funds or other reasons. Currently, if self.withdraw(amount) raises an exception, the other_account.deposit(amount) will not be executed, but the exception will not be caught or handled.

Suggested change
def transfer(self, other_account, amount):
if not isinstance(other_account, BankAccount):
raise ValueError("Recipient must be a BankAccount instance")
self.withdraw(amount)
other_account.deposit(amount)
return self.balance, other_account.balance

@github-actions
Copy link
Contributor

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants