Skip to content

Commit

Permalink
πŸ› Add cash_balance property to FakePortfolio (#63)
Browse files Browse the repository at this point in the history
---

<details open="true"><summary>Generated summary (powered by <a href="https://app.graphite.dev">Graphite</a>)</summary>

> ## TL;DR
> This pull request introduces a new property `cash_balance` to the `Portfolio` class in `conftest.py` under the tests directory.
> 
> ## What changed
> A new property `cash_balance` was added to the `Portfolio` class. This property returns a float value of 0. This change is reflected in the `conftest.py` file.
> 
> ```python
> @Property
> def cash_balance(self) -> float:
>     return 0
> ```
> 
> ## How to test
> To test this change, you can create an instance of the `Portfolio` class and access the `cash_balance` property. The expected return value should be 0. 
> 
> ```python
> portfolio = Portfolio()
> print(portfolio.cash_balance)  # should print 0
> ```
> 
> ## Why make this change
> This change was made to provide a way to access the cash balance of a portfolio. This can be useful in scenarios where we need to check if the portfolio has enough cash balance to make a transaction.
</details>
  • Loading branch information
mingi3314 authored Dec 31, 2023
1 parent ac03048 commit 2b7b98d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def __init__(self) -> None: ...
def total_value(self) -> float:
return 100000

@property
def cash_balance(self) -> float:
return 0

@property
def positions(self) -> list[Position]:
return [
Expand Down

0 comments on commit 2b7b98d

Please sign in to comment.