Skip to content

Commit

Permalink
Identified and fixed corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Feb 26, 2020
1 parent 65f3beb commit b79e8ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion random_csv_generator/random_csv.py
Expand Up @@ -8,7 +8,10 @@

def money_amount():
total = random.randrange(0, 100000)
payed = random.randrange(0, total)
if total > 0:
payed = random.randrange(0, total)
else:
payed = 0
return {
"total_debit": locale.currency(total, grouping=True),
"payed_debit": locale.currency(payed, grouping=True)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -33,7 +33,8 @@ def find_version(*file_paths):
"pytest-cov",
"coveralls",
"validate_version_code",
"codacy-coverage"
"codacy-coverage",
"tqdm"
]

extras = {
Expand Down
4 changes: 3 additions & 1 deletion tests/test_random_csv.py
@@ -1,4 +1,6 @@
from random_csv_generator import random_csv
from tqdm.auto import tqdm

def test_random_csv():
random_csv()
for _ in tqdm(range(10)):
random_csv()

0 comments on commit b79e8ae

Please sign in to comment.