Budget app spend chart expecting incorrect output?

hey all,
I’m inches from completing the budget app but I can’t get the spend chart to work. While I have a couple of tweaks to fix it, when I look at main.py it shows the auto category has a deposit of $1000 then a spend function of $15 which means the chart should show a usage rate of 0% (1.5% rounded down). Yet in the test.py portion, the output it is expecting is a usage rate of 20%. Or at least that’s what it looks like to me

is there a way to see what spend charts it’s expecting?

here’s what I’ve got:
link

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Challenge: Budget App

Link to the challenge:

Please read the task again - the spend chart is based on “spending” not on “deposit”.
If you spend 15$ on food and nothing else → that’s 100%.
Ifyou spend 15$ on food and 45$ on clothing → that’s 25% (round 20) and 75% (round 70).

1 Like

Well that definitely makes a difference, but I’m still failing 1 test. Is there a way to see what the output it expected was like there was in the prior two projects?

Two actually.
One is reading the assertion-error, though it’s not as neatly formatted:

AssertionError:
'Perc[26 chars]100| o  \n 90| o  \n 80| o  \n 70| o  \n 60| o[270 chars] t\n'
!= 
'Perc[26 chars]100|          \n 90|          \n 80|          [348 chars] t  '

So for whatever reason your chart lacks spacing and includes a bar that goes up to 100%.

Or we look at the failing test name FAIL: test_create_spend_chart (test_module.UnitTests) and go in the files to the test_module.py and look at the test by this name and it’s expected value.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.