Skip to content

Commit

Permalink
fix: Currency TEst
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanildoBarauna committed Jun 27, 2024
1 parent 2f758ee commit 631e51c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/currency_quote/domain/entities/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def __init__(self, currency_list: list):
self.currency_list = currency_list

def get_currency_list(self) -> list:
if self.currency_list is None:
if len(self.currency_list) == 0:
raise ValueError("Currency list is empty")

return self.currency_list
8 changes: 8 additions & 0 deletions src/currency_quote/domain/entities/test_currency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pytest
from currency_quote.domain.entities.currency import CurrencyQuote


def test_currency():
client = CurrencyQuote(currency_list=[])
with pytest.raises(ValueError):
client.get_currency_list()

0 comments on commit 631e51c

Please sign in to comment.